pdf-lib icon indicating copy to clipboard operation
pdf-lib copied to clipboard

Incremental PDF update, with automatic change tracking, or manual tracking of changes. Fixes issue #816

Open adnsistemas opened this issue 8 months ago • 0 comments

What?

Remdra changes implements incremental update. Over that I added the automatic change tracking, so you only has to add a parameter on PDF load, for it to be saved with incremental updates. On save, you can force rewrite, if open for incremental update.

Why?

Incremental updates are a requirement for electronic signatures, otherwise, only the last signature remains valid, and all the previous ones are invalidated on PDF rewrite.

How?

Remdra changes implements the concept of 'snapshot' wich tracks new PDF objects and allows you to register objects that has changed, to be included in the incremental update to add at the end of the original PDF file. Over that I added the preservation of the snapshot at PDF context and the autochangeregistration of PDF Objects, when they change, with context.

Testing?

Added test. Run all tests except ios/android

New Dependencies?

No.

Screenshots

No visual changes.

Suggested Reading?

I've read PDF standard several times..

Anything Else?

Nothing else.

Checklist

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

adnsistemas avatar May 08 '25 19:05 adnsistemas