Closed Bug 2021583 Opened 8 months ago Closed 14 days ago

Saving PDF files causes rendering problems

Categories

(Firefox :: PDF Viewer, defect, P1)

Firefox 148
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: antonikowalczuk, Assigned: calixte)

References

Details

Attachments

(1 file, 1 external file)

Steps to reproduce:

Steps to reproduce

  1. Take any PDF with words, e.g., rendered using overleaf.
  2. Click "Print" -> Save as PDF (useful when only subset of pages is needed).
  3. Open Finder, locate the file.
  4. Open with -> Firefox.
  • Device: MacBook Pro M3 with macOS 14.2 (23C64), and Macbook Pro A2918 M3 with macOS Tahoe 26.3.
  • Build version: Version 148.0 (64-bit), Firefox 148.0 (aarch64).
  • First seen version: Version 148.0 (64-bit)), Firefox 148.0 (aarch64).

I attach a PDF file after performing steps 2->4, where the first step includes rendering the PDF in overleaf using this template (I couldn't attach two PDFs).

Actual results:

Actual behavior

Some characters are not rendered, especially capital letters. The problem was reproduced on two MacBook laptops (steps 1 to 4, mentioned above), and rendering issues persist on Chrome browser, on Windows, and in Slack messenger. For some browsers, like Safari or Microsoft Edge, the PDFs render correctly.

Expected results:

Expected behavior

Everything is rendered properly.

The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → PDF Viewer

The severity field is not set for this bug.
:calixte, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(cdenizet)

I cannot reproduce the issue on Windows 11 but I can on mac so it's very likely related the pdf backend used when printing.
For whatever reason the char id used to draw the "C" (on the first page) is \u0000 which is a very bad idea.
Overall the font encoding looks completely wrong, for example if I copy and paste "Some Class\nRandom Examples" from either Acrobat or Firefox, I get:

Rnld 􀀀eYrr
NYmanl CuYloedr

There's no issue when doing the same with the pdf generated on Windows.

Out of curiosity, I checked the skia print backend and the C is correctly drawn but unfortunately the printed page is an image.
Jonathan, would you have any ideas ?

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(cdenizet) → needinfo?(jfkthame)
Priority: -- → P3

With the new print backend, it should be fine now.
Ghostscript is rendering the pdf correctly so there's something we can fix in pdf.js.

Assignee: nobody → cdenizet
Status: NEW → ASSIGNED
Priority: P3 → P1
Depends on: 2092381
Flags: needinfo?(jfkthame)
No longer depends on: 2092381
Depends on: 2092533
Status: ASSIGNED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
QA Whiteboard: [qa-triage-done-c163/b162] [qa-ver-needed-c163/b162]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: