Skip to content

Conversation

parvit
Copy link

@parvit parvit commented Aug 10, 2025

What?

This PR fixes issue #951.

How?

Issue pops up in files which use the "Incremental Update" feature and have modifed indirect objects in the updated sections but no new objects added.
If the operation of sorting by object number is done for this kind of documents in the created context, than the objects are written at the wrong offsets and readers become confused leading to the rendering errors.
In case instead where new objects are added to the file, the sorting is necessary to consolidate the changes. At least that is what i've observed as simply removing the sorting lead to tests 17 and 18 to become corrupted (because those tests load a file with multiple update sections and add new objects).

Testing?

Tested by introducing a new test19 integration test which loads the problematic file and then executes the save operation to show the produced pdf file to the browser.

New Dependencies?

No

Screenshots

N/A

Checklist

  • I read CONTRIBUTING.md.
  • I read MAINTAINERSHIP.md#pull-requests.
  • I added/updated unit tests for my changes.
  • I added/updated integration tests for my changes.
  • I ran the integration tests.
  • I tested my changes in the browser.
  • I viewed documents produced with my changes in Adobe Acrobat, Foxit Reader, Firefox, and Chrome.
  • I added/updated doc comments for any new/modified public APIs.
  • My changes work for both new and existing PDF files.
  • I ran the linter on my changes.

@parvit
Copy link
Author

parvit commented Sep 6, 2025

@Hopding could you review the change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant