Incremental Update Change Automatic Registration#1
Open
adnsistemas wants to merge 248 commits intoremdra:masterfrom
Open
Incremental Update Change Automatic Registration#1adnsistemas wants to merge 248 commits intoremdra:masterfrom
adnsistemas wants to merge 248 commits intoremdra:masterfrom
Conversation
…ify saving consistency
…e and incremental generation. Parameter adding for incremental update saving, to force useObjectStreams preference
- Add commit() method to PDFDocument enabling chained incremental updates - Fix font duplication: change 'modified' flag to 'alreadyEmbedded' in PDFFont - Use PDFWriter instead of PDFStreamWriter for incremental saves - Add comprehensive tests for commit() functionality (17 test cases)
- Add commit() method to PDFDocument enabling chained incremental updates - Fix font duplication: change 'modified' flag to 'alreadyEmbedded' in PDFFont - Use PDFWriter instead of PDFStreamWriter for incremental saves - Add comprehensive tests for commit() functionality (17 test cases)
Previously, inline objects (arrays/dicts embedded directly in other objects, not registered as indirect objects) would not be tracked for incremental saves. This caused changes to inline arrays like MediaBox to be lost. The fix enhances PDFContext.registerObjectChange() to: 1. First check if the object is directly registered (indirect object) 2. If not, search through all indirect objects to find which one contains the inline object, and mark that parent for save Also fixed lint-staged config that had broken shell commands. Added test: 'tracks inline array modifications for incremental saves' All 673 tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
It automates the incremental update object change registration, making incremental update as easy as adding a parameter on document load.
Why?
It's very error prone to be required to manually register every ref that has to be included in an incremental update.
How?
The snapshot is preserved at the pdf context, and every PDFObject registers when it changes, with the context. If the PDF has an original file (was loaded) then this changes get registered in the snapshot taken on document load.
Testing?
Added a couple of tests. Run all the tests, and integration tests for Node, Deno and Browser.
New Dependencies?
No
Screenshots
No visual changes.
Suggested Reading?
I already know the PDF standard pretty well.. no need to read it again.
Anything Else?
I will add a Pull Request to the orinal PDF-LIB.
Checklist