Closed Bug 1274502 Opened 8 years ago Closed 7 months ago

PDF is printed as image

Categories

(Firefox :: PDF Viewer, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1774631

People

(Reporter: rimas, Unassigned)

Details

(Whiteboard: [pdfjs-integration][pdfjs-printing])

Attachments

(3 files)

I noticed that when printing a PDF file from our built-in viewer, the edges of text are not as crisp as they should be, or as crisp as when printing a web page. I did some investigation, and it seems that the viewer prints PDF's as somewhat raster images.

It would be great if it were printed as curves instead. Ideally, even textual information would be preserved as well, so that if I print PDF to another PDF, I could still select text.

Attaching sample PDF's. One is printed from Firefox while in a website, and the other one is a re-print of the first one opened in the built-in PDF viewer.
Priority: -- → P3
Whiteboard: [pdfjs-c-integration][pdfjs-d-printing]
See Also: → 1269023
Whiteboard: [pdfjs-c-integration][pdfjs-d-printing] → [pdfjs-integration][pdfjs-printing]
See Also: → 1772225

What OS did you print on?

Flags: needinfo?(rimas)

I filed this 6 years ago, so I honestly can't say for sure what OS I was using back then. But it must have been either Linux or Windows.

Although I really doubt that the OS matters, which is why I didn't include it in my bugreport.

Flags: needinfo?(rimas)

(In reply to Rimas Kudelis [use needinfo to ping] from comment #4)

I filed this 6 years ago, so I honestly can't say for sure what OS I was using back then. But it must have been either Linux or Windows.

Although I really doubt that the OS matters, which is why I didn't include it in my bugreport.

It is actually platform specific, as it depends on the Cairo backend that is being used.

Given your response I assume the answer is going to be "no", but are you still seeing this bug nowadays?

Flags: needinfo?(rimas)

I just reprinted the same "Printed from website" file to PDF using the Save as PDF virtual printer on Firefox 101.0.1 on Ubuntu Linux 20.04, and I got the exact same problem: the printed file is 10+ times larger, has no selectable text, and zooming it to 1000% clearly shows distortion, whereas a file printed from HTML is both smaller in size and allows text selection, and looks much better when zoomed in to 1000%. So I'd say yes, I am still seeing this bug nowadays.

The newly printed files report Cairo as version 1.17.4.

I admit however that even text PDF-printed from HTML loses its crispiness when zoomed in that much, both then and now. I wonder if this is inherent to how PDF works or an issue in Cairo.

Flags: needinfo?(rimas)

Are you able to reproduce on Windows too?

Flags: needinfo?(rimas)

Yes, I am able to reproduce this on Windows with Firefox 101.0.1 as well, which uses the exact same version of Cairo.

Flags: needinfo?(rimas)
Severity: normal → S2
See Also: → 1774631

On the left: print from HTML. Text is selectable and even the links work.
On the right: print from PDF. Text is not selectable, noticeably blurrier and the links don't work.
OS: WIndows 10, browser: Firefox 101.0.1

(In reply to Marco Castelluccio [:marco] from comment #10)

This was fixed by bug 1774631.

That bug was about "save as PDF", but my problem is more generic, since I'm facing it when printing using an actual hardware printer. I attached samples as PDF's because it didn't seem to matter at the time, as both the hardware printer and the pdf printer produced comparably bad result.

So, at least for the case of hardware printers, this but doesn't seem fixed. I had to print a shipping label from a PDF file just now, and the pages produced when printing it from Firefox 117 were of considerably worse quality than those produced when printing the same file using Gnome's own document viewer. Firefox still seemed to print the document after rasterizing it first, which caused general blurriness and even caused a printed PDF417 barcode become unreadable.

The upstream pdf.js issue (2750) isn't even closed, so I don't think this can be marked as a duplicate of a fixed bug.

Status: RESOLVED → REOPENED
No longer duplicate of bug: 1774631
Resolution: DUPLICATE → ---

(In reply to Rimas Kudelis [use needinfo to ping] from comment #11)

(In reply to Marco Castelluccio [:marco] from comment #10)

This was fixed by bug 1774631.

That bug was about "save as PDF", but my problem is more generic, since I'm facing it when printing using an actual hardware printer. I attached samples as PDF's because it didn't seem to matter at the time, as both the hardware printer and the pdf printer produced comparably bad result.

I had tested this and it worked, so I assumed it was fixed:
(In reply to Rimas Kudelis [use needinfo to ping] from comment #6)

I just reprinted the same "Printed from website" file to PDF using the Save as PDF virtual printer on Firefox 101.0.1 on Ubuntu Linux 20.04, and I got the exact same problem

Are you now able to reproduce the bug only when using the hardware printer and not when using "Save as PDF"?

So, at least for the case of hardware printers, this but doesn't seem fixed. I had to print a shipping label from a PDF file just now, and the pages produced when printing it from Firefox 117 were of considerably worse quality than those produced when printing the same file using Gnome's own document viewer. Firefox still seemed to print the document after rasterizing it first, which caused general blurriness and even caused a printed PDF417 barcode become unreadable.

Could you share an example PDF with which you can reproduce this?

The upstream pdf.js issue (2750) isn't even closed, so I don't think this can be marked as a duplicate of a fixed bug.

There are multiple causes for print blurriness, 2750 might be a specific one that has nothing to do with yours.

Flags: needinfo?(rimas)

Okay, this is weird.

I have since deleted that PDF file with the shipping labels that I mentioned above, but I tried reproducing the issue with several other files (including some other shipping labels) today almost to no avail. Everything printed out just fine, except one PDF which was blurry even on screen and didn't allow me to select text, thus I assume it was already a rasterized image.

I'm sorry for making noise. I'm closing this bug now and will reopen it or create a new one if I hit this issue and have a suitable PDF file to investigate it again.

Status: REOPENED → RESOLVED
Closed: 2 years ago7 months ago
Duplicate of bug: 1774631
Flags: needinfo?(rimas)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: