feat(edit-pdf): detect and fill existing AcroForm fields (#9) - #64
Merged
Merged
Conversation
McanKul
requested changes
Aug 28, 2026
McanKul
left a comment
Owner
There was a problem hiding this comment.
Thanks for the substantial form work. The flatten path needs to be fail-closed before merge: attach_xobjects_and_content replaces the page’s existing /Resources /XObject entry, which can break existing images/forms, and widgets without a usable /Rect + /AP are removed without being painted. Please preserve/merge existing resources, keep any widget that cannot be safely flattened, and add regression coverage. Please rebase onto current development after #55.
List catalog fields from the source path, overlay HTML controls at unrotated widget rects, and write /V plus hand-rolled /AP (Noto for text; drawn streams for checkbox/radio so viewers show the state). Flatten is opt-in and widgets-only. XFA and extra-file forms error. Fixes McanKul#9.
…dgets Merge flatten paints into the page's existing /Resources /XObject instead of replacing it. Widgets without a usable /Rect or /AP stay on dest /Annots instead of being dropped unpainted.
nonamexishere
force-pushed
the
feat/9-acroform-fill
branch
from
August 28, 2026 20:48
63605be to
62dc189
Compare
McanKul
approved these changes
Aug 29, 2026
McanKul
left a comment
Owner
There was a problem hiding this comment.
Thanks again for the AcroForm work. I integrated it with the annotation editor, preserved inherited page resources during flattening, and added regression coverage. All local and CI checks 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.
Summary
/Vand regenerate/AP(bundled Noto for text; drawn Form XObject streams for checkbox/radio so Preview/Chrome show the on-state)./Sigskipped. Hidden/read-only not changed.Fixes #9.
Test plan
cargo test --lib edit_forms(F1–F17)npm test/npm run typecheck/cargo test --libqa-form-fill.pdf, Agree + Size M visible after Save