How to avoid Custom print lay out Screen, Print and PDF format differences

Created a new Custom print layout (HTML & CSS) on the screen and printed the PDF button the layout shows differently, showing only 50% of the data on the screen. screen and print margins are showing differently. How to make 3 format same.

This happens because the screen preview uses the browser’s view, but the PDF is made with wkhtmltopdf, which can handle HTML and CSS differently. So, it’s tricky to make them exactly the same. Adjusting the CSS to be more compatible with wkhtmltopdf and using print-specific styles can help, but perfect consistency is hard to achieve.

1 Like

You can use Chrome Headless to render PDF. Chrome Headless will maintain consistency across prints and PDF. However chrome headless does not support repeating headers and footers or page numbering.

To have repeating headers and footers you can structure your print format as the following:

To add page numbering;

Of course these should be done in a custom print format.

1 Like