Added support to only flatten some fields #1758
Open
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
options
argumentTesting?
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