Repository navigation
Add support for field hierarchies - #5097
Merged
Merged
Conversation
JorjMcKie
force-pushed
the
support-field-hierarchy
branch
6 times, most recently
from
August 21, 2026 16:40
c6f1a82 to
adced32
Compare
Collaborator
|
[mupdf master and 1.28.x have just been updated with the fix for swig-4.5. We need to rerun test_quick after these changes have made it to the github mupdf mirror, so rerun in an hour or so.] |
JorjMcKie
force-pushed
the
support-field-hierarchy
branch
from
August 23, 2026 16:23
e952263 to
2305bd0
Compare
julian-smith-artifex-com
force-pushed
the
support-field-hierarchy
branch
from
August 24, 2026 12:19
06baf10 to
5bbe429
Compare
julian-smith-artifex-com
force-pushed
the
support-field-hierarchy
branch
from
August 24, 2026 13:21
5bbe429 to
7a13d23
Compare
julian-smith-artifex-com
approved these changes
Aug 24, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This fix adds Form Field hierarchy support to our Widget handling.
Background:
PyMuPDF (like MuPDF itself) always inserts new Form Fields as widgets on the respective page. All inserted widgets automatically become root fields in the PDF.
There is no way to add complex information structures like
Person.Name.Firstsuch that the widget only has the name partFirstand the other segments are parents in multiple hierarchy levels.This fix solves this by automatically adding the hierarchy where needed. For the example above, a chain
Person → Name → Firstwill be created.Personbecomes a root field pointing toNamevia its/Kidsarray, and similarlyNamepoints toFirst.NameandFirstin turn will point backwards to their parents via the/Parentkey. This allows for tree-like information structures like this:The only root field would be
Person. The four level 3 items would represent widgets living on any pages.This behavior is triggered by the presence of the name segmentation indicator colon ".".
If no colon is present, the old behavior occurs.