printToPDF produces a file that is small and low-resolution relative to Chrome
Categories
(Remote Protocol :: CDP, defect, P3)
Tracking
(Not tracked)
People
(Reporter: impossibus, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(2 files)
Taking a screenshot of the same document in Chrome and Firefox produces different-quality pdf files: the pdf produced by Chrome has a much larger file size and image resolution. See attached example pdfs, which are the result of running the script from this (unrelated) Puppeteer issue: https://github.com/puppeteer/puppeteer/issues/5671
Snippet:
await page.pdf({
printBackground: true,
fullPage: true,
path: 'issue-5671.pdf'});
A recent change affecting printToPDF is Bug 1632722, but the PDF quality difference was present before that fix landed.
Reporter | ||
Comment 1•4 years ago
|
||
Reporter | ||
Comment 2•4 years ago
|
||
True both with and without headless.
Might be Linux-specific (I've only tried there.)
I can see some differences in file metadata:
- Chrome pdf: format PDF 1.4, producer Skia/PDF m85
- Firefox pdf: format PDF 1.5, producer cairo 1.9.5 (http://cairographics.org)
Comment 3•4 years ago
|
||
Jonathan, is there any way for us right now to specify the compression of the PDF file as generated by Firefox? I can remember that you are working on a refactoring, so maybe it could be added if not existent yet?
Comment 4•4 years ago
|
||
There's no way to do this currently, but bug 1639844 covers the first necessary step to make this possible.
Comment 5•4 years ago
|
||
Good to know. I will mark it as blocker for now to keep track of activity.
Comment 6•4 years ago
|
||
Bug 1662820 increased the default resolution for Windows, and bug 1664258 increased it for other platforms and added the float pref print.default_dpi
to make this configurable. (Note float prefs are stored as strings, in case anyone wants to experiment with that.)
Assignee | ||
Updated•4 years ago
|
Updated•3 years ago
|
Comment 8•1 year ago
|
||
If it's failing or not anymore, we are not going to fix this bug for CDP.
Description
•