iText

pdfHTML: Responsive Design

This is an example of how pdfHTML is able to reflow the contents of generated PDF documents using responsive design. The code below demonstrates using media queries and floating elements defined in a CSS style sheet and page size constraints.

pdfhtmlresponsivedesign

##GITHUB:https://github.com/itext/i7js-examples/blob/develop/src/main/java/com/itextpdf/samples/sandbox/pdfhtml/PdfHtmlResponsiveDesign.java##


##GITHUB:https://github.com/itext/i7ns-samples/blob/develop/itext/itext.samples/itext/samples/sandbox/pdfhtml/PdfHtmlResponsiveDesign.cs##



Resources

https://github.com/itext/i7js-examples/blob/develop/src/main/resources/pdfhtml/ResponsiveDesign/responsive/responsive.css
https://github.com/itext/i7js-examples/blob/develop/src/main/resources/pdfhtml/ResponsiveDesign/responsive/responsive.html

Results

https://github.com/itext/i7js-examples/blob/develop/cmpfiles/sandbox/pdfhtml/cmp_responsive_315.0.pdf
https://github.com/itext/i7js-examples/blob/develop/cmpfiles/sandbox/pdfhtml/cmp_responsive_540.0.pdf
https://github.com/itext/i7js-examples/blob/develop/cmpfiles/sandbox/pdfhtml/cmp_responsive_631.5.pdf