Printing from pdf.js rescales/resizes/shrinks output (compared to Adobe Reader printout, both at 100% scaling)
Categories
(Core :: Printing: Output, defect)
Tracking
()
People
(Reporter: thomas8, Unassigned)
References
()
Details
(Whiteboard: [pdfjs-printing])
Attachments
(7 files, 1 obsolete file)
| Reporter | ||
Updated•12 years ago
|
Updated•12 years ago
|
| Reporter | ||
Updated•12 years ago
|
| Reporter | ||
Comment 1•12 years ago
|
||
| Reporter | ||
Comment 2•12 years ago
•
|
||
| Reporter | ||
Comment 3•12 years ago
|
||
| Reporter | ||
Comment 4•12 years ago
|
||
| Reporter | ||
Updated•12 years ago
|
| Reporter | ||
Updated•12 years ago
|
| Reporter | ||
Comment 5•12 years ago
|
||
| Reporter | ||
Updated•12 years ago
|
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
| Reporter | ||
Updated•12 years ago
|
| Reporter | ||
Updated•12 years ago
|
Comment 13•12 years ago
|
||
| Reporter | ||
Comment 14•12 years ago
|
||
| Reporter | ||
Comment 15•12 years ago
|
||
| Reporter | ||
Comment 16•12 years ago
|
||
| Reporter | ||
Comment 17•12 years ago
|
||
| Reporter | ||
Updated•12 years ago
|
Comment 18•12 years ago
|
||
| Reporter | ||
Comment 19•12 years ago
|
||
Comment 20•12 years ago
|
||
Comment 21•12 years ago
|
||
Comment 22•11 years ago
|
||
Comment 23•10 years ago
|
||
Comment 24•10 years ago
|
||
Comment 25•10 years ago
|
||
Comment 27•4 years ago
|
||
Hi Thomas!
I'm trying to reproduce old bugs to see if we can resolve some.
Due to Firefox having change a lot, maybe this problem doesn't happen anymore. I was wondering if you can share it again.
Thanks!
| Reporter | ||
Comment 28•4 years ago
|
||
(In reply to Marcela from comment #27)
Hi Thomas!
I'm trying to reproduce old bugs to see if we can resolve some.
That's great Marcela!
Due to Firefox having change a lot, maybe this problem doesn't happen anymore. I was wondering if you can share it again.
Thanks!
Much better now compared to the original report.
Using testcase1, attachment 720284 [details], Firefox printouts now crispy clear, but still a little bit smaller (2.x %) than direct Printing from Adobe Reader (both scaled to 100%) - would need a better testcase with a measured graphic to find out which one is closer to the original size.
FF 93.0 (64-bit), inbuilt unified Print dialog, Scale: 100%
- width of first line (Congratulations...): 15.4 cm on printout (2.5% smaller than Adobe Reader)
(FF 22 printed this line 14.5 cm, maybeFit to pagewas applied?) - height of printed area max (top corner of the Y of Yukon to bottom of
sin "Please visit..."): 9.2 cm (2.1% smaller than Adobe Reader)
Adobe Reader, print original size or 100%
- width of first line (Congratulations...): 15.8 cm on printout
- height of printed area max (top corner of the Y of Yukon to bottom of
sin "Please visit..."): 9.4 cm
| Reporter | ||
Updated•4 years ago
|
| Reporter | ||
Comment 29•4 years ago
|
||
Comment on attachment 9248045 [details]
PDF: Scans of testcase1 printouts, scaled 100%, on FF93.0 (64-bit), Win10 vs. Adobe Reader
You can see the 2.x % difference in size between Firefox vs. Adobe Reader printouts when you open the PDF and flip from page 1 (FF) to page 2 (Adobe reader) and back while looking at the printed area.
| Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 30•2 years ago
|
||
Given comment 28, this looks more like a Core problem at this point rather than a problem within pdf.js.
Comment 31•2 years ago
|
||
The severity field is not set for this bug.
:dshin, could you have a look please?
For more information, please visit BugBot documentation.
Comment 32•2 years ago
|
||
Bottom printout is from Firefox, with the folded top printout from Adobe Acrobat Reader DC.
I wonder if we somehow scale down to unprintable margins here...?
Updated•2 years ago
|
Comment 33•4 months ago
|
||
In Firefox 144, it appears you can print the test case without added margins (same as Acrobat's "Actual" option) by setting Margins to either "Default" or "None". However, users with Margins set to "Custom" will need to switch back and forth manually. Does it make sense to ignore custom margins for PDFs? I'm inclined to think that if someone sets custom margins, they probably prefer to be in control. That said, it would be nice to have a checkbox to "Ignore for PDFs" to ease the switching process.
Comment 34•1 day ago
|
||
I can reproduce a related issue where PDF content is clipped at the edges when printing from Firefox, while the same PDF prints correctly (edge-to-edge) from Acrobat Reader.
Steps to reproduce:
- Open a full-bleed PDF (content extends to page edges) in Firefox via PDF.js
- Open the print dialog
- Print to a physical printer or "Save as PDF"
Actual result:
Content is clipped at the edges. Changing the margin setting from "Default" to "None" has no effect.
Expected result:
Content prints edge-to-edge, as it does when printing the same PDF from Acrobat Reader.
Key observation:
The print preview in Firefox shows the content correctly — nothing is clipped. The clipping only occurs in the actual print output (both to physical printer and "Save as PDF"). This indicates the issue occurs in the pipeline between the print preview and the data sent to the printer.
Root cause (suspected):
PDF.js renders the PDF onto an HTML Canvas for screen display. This canvas is rasterized at screen resolution and passed to the print pipeline as a bitmap. During the canvas rendering step, PDF.js appears to apply a slight internal scaling or padding that clips edge content. Since the output is a raster image rather than vector data, this clipping is baked in and cannot be corrected downstream.
Acrobat Reader does not exhibit this issue because it passes the PDF as vector data directly to the print spooler, preserving the original page geometry.
This is consistent with the core issue in this bug: PDF.js treating PDFs as web content and applying browser-style rendering and margins, rather than passing the original PDF geometry through to the printer.
Description
•