Closed Bug 1961423 Opened 29 days ago Closed 18 days ago

Using "Save to PDF" corrupts glyph in other PDF viewers

Categories

(Firefox :: PDF Viewer, defect, P1)

Firefox 137
Desktop
macOS
defect

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: laurenz.stampfl+github, Assigned: calixte)

References

Details

Attachments

(3 files)

Attached file original.pdf

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0

Steps to reproduce:

I have a simple PDF file "original.pdf" which displays fine in any PDF viewer. I opened the PDF in Firefox and resaved it by pressing "Print" and "Save to PDF".

Actual results:

The resaved PDF still displays fine when opening in Firefox, but when trying any other viewer (Chrome, Apple Preview and Acrobat), the first glyph suddenly ends up being displayed as a .notdef glyph.

Expected results:

The text should still display fine in any PDF viewer.

Attached file The resaved PDF

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

Hello, thank you for the bug report!
Managed to reproduce this issue using:

  • Firefox Nightly 139.0a1;
  • Firefox 138.0;

Tested on macOS 14. Could not reproduce on Windows 10 (with Adobe Acrobat Reader) or Ubuntu 22 (with Document Viewer).

Setting as NEW so the developing team can have a look.

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → macOS
Hardware: Unspecified → Desktop

The used font is a CFF one and we rewrite it a bit in order to make it usable in Firefox.
The last version of ttx was failing and a way to fix the failure is to change the nLeftvalue here:
https://github.com/mozilla/pdf.js/blob/91175dc67d13addbc0c172858fb87bae8c8212af/src/core/cff_parser.js#L1769-L1779
which is supposed to be the number of glyphs in the range except the first one.
And fixing the ttx failure is fixing this bug in Firefox too.

Assignee: nobody → cdenizet
Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: