Printing in A4 is damaged
Printing is damaged. All margins are set to zero. When you look at the print preview, you can see that the width of the document must be smaller and the height must be larger. With the red boxes, I made sure that it was A4. It is displayed correctly in other browsers, but not in Firefox. See the screenshot. What can I do?
Chosen solution
In the meantime I have found the solution.
about:config -> print . printer_Microsoft_Print_To_PDF . print_paper_size_unit -> 0 to 1
Now I have a new problem: The page overlaps by 0.4mm. Means I have to set the page to 210x296.6mm. How can that be? If I make the page 0.1mm larger, a new page will be created.
Read this answer in context 👍 0All Replies (8)
Hi Patrick, I'm not sure I understand the red lines/boxes test.
Is this a regular web page that needs to be fitted to your paper size, or is it a PDF that already was created for a particular paper size?
A lot of factors go into printing, some of which you cannot set directly in Print Preview and Page Setup. In particular, Firefox may not know you intend to use A4 sized paper until until you pop up the Print dialog and use the Preferences button to select a paper size, by which time you're out of Preview. Until you print to a new paper size, Firefox may re-use the last size rather than knowing your current intentions.
In addition to the margins you set in the Page Setup dialog, Firefox sometimes becomes aware of "unprintable" areas for your printer and automatically prevent you from using those. (You also can specify those yourself if you find your headers and footers being cut off.)
Print Preview is also an approximation. Are the lines getting cut off in the actual printout (to paper or PDF)?
The grid was created with via HTML, CSS and JavaScript. Millimeters are given in CSS, so each red box has a size of 10 mm. I also had to limit the last row by 7mm. The page size is 210x297mm. All other objects, such as the navigation, are hidden. I have to correct myself, in the Microsoft Edge the side is 1mm too long, which is still acceptable. Only in Firefox the view is not correct at all.
Modified
Chosen Solution
In the meantime I have found the solution.
about:config -> print . printer_Microsoft_Print_To_PDF . print_paper_size_unit -> 0 to 1
Now I have a new problem: The page overlaps by 0.4mm. Means I have to set the page to 210x296.6mm. How can that be? If I make the page 0.1mm larger, a new page will be created.
Progress!
Does Firefox show any unprintable area at the top or bottom which could account for the .4mm? Those preferences have names like:
- print.printer_Adobe_PDF.print_edge_top
- print.printer_Adobe_PDF.print_unwriteable_margin_top
Otherwise, perhaps there is a rounding error in the code that uses the measurement?
I have checked and changed all settings without success.
Modified
Although in theory at 96 dots per inch an A4 sheet has a length of over 1122 pixels (96 x 11.69 = 1122.24), if set to 100% scaling, Firefox won't fit more than 1121 pixels on the page for some reason.
I think you already have a bug on file for this?
The code in my script is fine. As stated in the title, printing with Firefox is damaged, broken or just buggy. I opened the same script with Microsoft Edge. See screenshots. How can I contact the developer?
Modified
You can file a bug on Bugzilla: