Add tagged content support inside transparency group XObjects#337
Open
dcalvo wants to merge 1 commit into
Open
Add tagged content support inside transparency group XObjects#337dcalvo wants to merge 1 commit into
dcalvo wants to merge 1 commit into
Conversation
Per ISO 32000-2 §14.7.4.4.2, Form XObjects created by push_opacity, push_mask, and push_isolated now participate in the structure tree. Each sub-builder gets its own MCID counter and XObjectTagId. Structure elements reference XObject content via MCR dicts with /Stm pointing to the XObject stream. XObjects with tagged content get /StructParents entries in the parent tree.
2f3d59f to
2dfb61a
Compare
Owner
|
Sorry, I haven't had the head space for krilla PRs recently, will try to take a look once I have a bit more time for that. 🙏 |
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.
This one is pretty chunky, sorry for opening so many PRs at once 😅 This is the last of the changes we've been carrying in our fork, happy to iterate on any of them. We're holding back a custom XMP callback PR for now.
When
Surfacecreates sub-builders for transparency groups (push_mask,push_opacity,push_isolated), the resulting Form XObjects don't carry/StructParentsentries. Anystart_tagged/end_taggedcalls inside the group emit BMC/EMC markers into the XObject's content stream, but those MCIDs aren't connected back to the page's parent tree. Tagged content inside transparency groups is invisible to the structure tree.As noted in #313, this makes it impossible to produce correct tagged output when content sits inside transparency groups.
The fix:
XObjectTagIdand inherit the parent's page indexstart_taggedin a sub-builder allocates MCIDs from the XObject's own counter/StructParentskey