Closed Bug 1844572 Opened 1 year ago Closed 1 year ago

PDF annotations not saved on certain PDFs

Categories

(Firefox :: PDF Viewer, defect, P1)

Firefox 117
defect

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- wontfix
firefox115 --- wontfix
firefox116 --- fixed
firefox117 --- fixed

People

(Reporter: pmenzel+bugzilla.mozilla.org, Assigned: calixte)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0

Steps to reproduce:

This is a regression since at least Firefox 115.0. It also does not work with Nightly 117.0a1 (20230715213801).

Open the attached PDF, make annotation and add text, and save it.

Actual results:

The annotations and added text are not saved.

Expected results:

It should be saved.

We only found this one PDF, that worked in the past. It works with other PDF files. Re-rendering the PDF file by plainly printing it, it works again.

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

Could you try using mozregression to figure out exactly what caused this issue?

Flags: needinfo?(pmenzel+bugzilla.mozilla.org)

Unfortunately I never got it to work, and do not have time to further look into it. A colleague reported, that they tried older versions, and it didn’t work in 112.0 (from April 2023) either. But they are pretty, pretty sure it had worked in the past.

Flags: needinfo?(pmenzel+bugzilla.mozilla.org)

I can reproduce, I'll try to use mozregression myself.

Flags: needinfo?(mcastelluccio)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mcastelluccio)

It's because the Acroform entry in Root isn't a reference and we're finally throwing when we try to write the acroformRef which is null:
https://github.com/mozilla/pdf.js/blob/0702663b7d994bf363328d6b818ded30605a5378/src/core/writer.js#L266C14
Since Root should be a reference (from specs Required; shall be an indirect reference), I think we must rewrite it in such case.

10:18.83 INFO: Last good revision: ef7f2899709705172b238d1ef7b9022ed98b290f
10:18.83 INFO: First bad revision: b78719ac48b811337492748d74fa73013b3e752f
10:18.83 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=ef7f2899709705172b238d1ef7b9022ed98b290f&tochange=b78719ac48b811337492748d74fa73013b3e752f

Regressed by: 1800502

That said in this case we don't have to update Acroform.

Set release status flags based on info from the regressing bug 1800502

Assignee: nobody → cdenizet
Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

The patch landed in nightly and beta is affected.
:calixte, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox116 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(cdenizet)

Done in bug 1845506.

Flags: needinfo?(cdenizet)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: