Closed Bug 1658333 Opened 4 years ago Closed 10 months ago

printToPDF produces a file that is small and low-resolution relative to Chrome

Categories

(Remote Protocol :: CDP, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: impossibus, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

Attached file issue-5671-firefox.pdf

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.

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)

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?

Flags: needinfo?(jwatt)

There's no way to do this currently, but bug 1639844 covers the first necessary step to make this possible.

Flags: needinfo?(jwatt)

Good to know. I will mark it as blocker for now to keep track of activity.

Depends on: 1639844

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.)

See Also: → 1662820, 1664258
Component: CDP: Page → CDP

I'll check if that still reproduces.

Flags: needinfo?(hskupin)
Severity: -- → S3
Priority: -- → P3

If it's failing or not anymore, we are not going to fix this bug for CDP.

Status: NEW → RESOLVED
Closed: 10 months ago
Flags: needinfo?(hskupin)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: