Skip to content

[Bug]: When a PDF file with incremental updates contains multiple xref sections, exporting the PDF after adding annotations results in the annotated page being displayed as blank. #20302

@klwjlalala

Description

@klwjlalala

Attach (recommended) or Link to PDF file

JADC2 via ABMS.PDF

JADC2 via ABMS(2).PDF

Web browser and its version

firefox 143.0.1

Operating system and its version

window11

PDF.js version

master branch

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Open the PDF in a browser and add any annotation.

  2. Export the PDF file with the added annotation.

  3. Open the exported annotated PDF file in the browser.

  4. Observe that the page with the annotation is blank.

What is the expected behavior?

The annotated page should display its content normally along with the annotation. The first submitted file is the original PDF, and the second is the PDF exported after adding annotations.

What went wrong?

I think. this PDF contains multiple xref tables. After annotations are added and exported, pdf.js performs another incremental update by appending a new xref table at the end. However, the /Prev entry in the new xref table is incorrect: it should point to the position of the last xref table in the original PDF, but instead it points to the first xref table of the original PDF. This causes the incremental update content to be lost.

Link to a viewer

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions