Repository navigation
BUG: Parse a string rect for add_uri into a rectangle - #4074
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4074 +/- ##
=======================================
Coverage 98.11% 98.12%
=======================================
Files 59 59
Lines 11489 11490 +1
Branches 2150 2150
=======================================
+ Hits 11273 11274 +1
Misses 122 122
Partials 94 94 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
added a commit
that referenced
this pull request
Sep 16, 2026
## What's new ### Security (SEC) - Limit size of alphabetical page labels (#4096) by @stefan6419846 ### Deprecations (DEP) - Replace PdfWriter method add_js (#3979) by @j-t-1 ### Performance Improvements (PI) - Move static value out of loop body for appearance stream data (#4087) by @stefan6419846 - Reduce number of full data lookups for attachment mapping API (#4081) by @stefan6419846 ### Bug Fixes (BUG) - Do not copy unrelated pages when appending pages with non-terminal fields (#4078) by @anandghegde - Use page reference for existing internal link targets (#4076) by @r-kamei - Arabic-Indic digits are reversed during text extraction (#4077) by @Syamjith-NK - Parse a string rect for add_uri into a rectangle (#4074) by @RavSinghChandan [Full Changelog](6.18.1...6.19.0)
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.
add_uri documents its rect argument as accepting the string form
"[ xLL yLL xUR yUR ]", but a string was wrapped in a single NumberObject:
NumberObject cannot parse that, so it warned and fell back to 0 — the
annotation's /Rect became a single 0 instead of a rectangle, leaving the link
with no clickable area. RectangleObject and list forms were unaffected.
The string is now split into its four numbers and built into a RectangleObject,
matching the documented behaviour and the other two input forms.
The existing test_add_uri already passed a string rect but never checked the
result; it now asserts the /Rect for both the string and list forms.
Offline suite passes, 1339 tests.
Used Claude (Opus) to help locate and patch this; I reviewed and tested the change.