ENH: Add /IRT (in-reply-to) support for markup annotations#3631
Merged
stefan6419846 merged 12 commits intopy-pdf:mainfrom Mar 4, 2026
Merged
ENH: Add /IRT (in-reply-to) support for markup annotations#3631stefan6419846 merged 12 commits intopy-pdf:mainfrom
stefan6419846 merged 12 commits intopy-pdf:mainfrom
Conversation
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.
Summary
Adds first-class support for PDF annotation replies (PDF spec 1.5, Table 170) to the
MarkupAnnotationbase class.New parameters on
MarkupAnnotationin_reply_to: Reference to a parent annotation (the object returned bywriter.add_annotation()). Sets the/IRTentry.reply_type: Either"R"(reply, default) or"Group"(grouped). Sets the/RTentry.annotation_name: Sets the/NMentry for annotation threading. Auto-generated as a UUID whenin_reply_tois set and no name is provided.Usage example
Design notes
Popup(parent=...)for referencing other annotations viaindirect_referencein_reply_toreceives an unregistered annotation object, matching the existingPopupbehaviorMarkupAnnotationsubclasses requirerect, so the workaround discovered in the issue thread (reply annotations need/Rectto be visible) is handled naturallyTests
5 new tests covering:
/IRT,/RT,/NMverification + round-trip readreply_type="Group"variantannotation_namewithoutin_reply_toannotation_namewithin_reply_toCloses #2065