Added support to only flatten some fields#1758
Open
betabites wants to merge 3 commits intoHopding:masterfrom
Open
Added support to only flatten some fields#1758betabites wants to merge 3 commits intoHopding:masterfrom
betabites wants to merge 3 commits intoHopding:masterfrom
Conversation
# Conflicts: # src/api/form/PDFForm.ts
Maxwbh
pushed a commit
to Maxwbh/pdf-lib
that referenced
this pull request
Jan 31, 2026
Analyzed popular forks and pending PRs to identify potential improvements: - SVG support (from cantoo-scribe/pdf-lib fork) - PDF encryption/decryption (from pdf-lib-plus-encrypt fork) - Incremental save for digital signatures (from pdf-lib-incremental-save) - Rounded rectangles (from pdfme/pdf-lib fork) - Hyperlinks support (PR Hopding#1691) - Form field improvements (PRs Hopding#1748, Hopding#1758) https://claude.ai/code/session_01T85UagjFeYdf4vUW9pzeyn
Maxwbh
added a commit
to Maxwbh/pdf-lib
that referenced
this pull request
Mar 2, 2026
Analyzed popular forks and pending PRs to identify potential improvements: - SVG support (from cantoo-scribe/pdf-lib fork) - PDF encryption/decryption (from pdf-lib-plus-encrypt fork) - Incremental save for digital signatures (from pdf-lib-incremental-save) - Rounded rectangles (from pdfme/pdf-lib fork) - Hyperlinks support (PR Hopding#1691) - Form field improvements (PRs Hopding#1748, Hopding#1758) https://claude.ai/code/session_01T85UagjFeYdf4vUW9pzeyn
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?
Makes a few line changes that allow users to (optionally) only flatten some fields when flattening a PDF form.
Why?
The purpose of this is to allow some fields to be pre-filled, without fully locking out all fields.
How?
The changes in this PR are intended to build upon the existing flattening logic. In the existing logic, one of the first steps
flatten()takes is to fetch all fields in the form, then iterate through them.This PR simply allows the PDFField objects to be passed in as a part of the
optionsargumentTesting?
The existing test cases were used. Given that this is only a 3-liner change, and doesn't really add any new features, I thought the existing tests would be enough.
I'm not able to run the integration tests due to a build error with ttypescript? Might need some help with that one...
New Dependencies?
No
Screenshots
N/A
Suggested Reading?
No
Anything Else?
Checklist