Set page reference for new field Widgets #1003
Merged
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?
Sets the page reference for field widgets when they are added to a page
Why?
Currently the library does not set the page reference, causing code intended to find the widget's page to fail. Notably, some internal code is also tripped up by this currently as it uses the same methodology.
Ex:
`
`
How?
A function has been added to PDFField updateWidgetPageReference that takes the widget annotation and the PDFRef for the page and adds that reference to the widget's dictionary.
This function is called at the end of a fields addToPage function just after adding the widget annotation to the page's internal node
Testing?
I added a unit test for each field that supports an addToPage function. Upon making my changes, I verified that those tests now passed. I also checked the Integration tests to be sure nothing there was messed up. Everything appeared to be in order.
New Dependencies?
No
Screenshots
N/A
Suggested Reading?
Partly
Anything Else?
Linter found a lint rule violation in the src/api/index.ts file. I did not push that as it was unrelated to this fix
Checklist