-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Use NumberObject for /Border elements of annotations #2451
Conversation
Change NameObject to NumberObject in lines 328 and 330 It will pass the array as a string and not an int if it is a NameObject and will cause a warning in the Class NameObject method renumber "Incorrect first char in NameObject:({self})" line 592 _base.py (pypdf.generic) resolves py-pdf#2444 Issue
You do not need to open a new PR and close the old PR for each modification you do. Could you please add a corresponding test case as well which shows the previous issue and demonstrates that your fix does indeed solve this? Apparently you would get warnings previously (#2447 (comment)), which might be something to check. |
I'm sorry I have never done this before. I'm just learning by making a lot of mistakes. I deleted the branch after summiting the first PRs, which closed the PRs and lost the all of the code changes, so I made new PRs trying to fix the error. I made a pdf describing the bug in more detail with screen shots for you. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2451 +/- ##
=======================================
Coverage 94.43% 94.43%
=======================================
Files 49 49
Lines 8008 8008
Branches 1616 1616
=======================================
Hits 7562 7562
Misses 276 276
Partials 170 170 ☔ View full report in Codecov by Sentry. |
Congratulations to your first accepted contribution @rsinger417 ! Thank you for helping to improve pypdf 🙏 If you want, I can add you to https://pypdf.readthedocs.io/en/latest/meta/CONTRIBUTORS.html :-) |
The fix will be released in |
I like that the PR was small - especially for first contributions this is a good idea 👍 A few details to watch out for the next time. Don't worry, in this PR I took care of it already:
|
## What's new ### Bug Fixes (BUG) - Use NumberObject for /Border elements of annotations (#2451) by @rsinger417 ### Documentation (DOC) - Document easier way to update metadata (#2454) by @stefan6419846 - Typo `Polyline` \xe2\x86\x92 `PolyLine` in adding-pdf-annotations.md (#2426) by @CWKSC ### Developer Experience (DEV) - Bump codecov/codecov-action from 3 to 4 (#2430) by @dependabot[bot] ### Testing (TST) - Avoid catching not emitted warnings (#2429) by @stefan6419846 [Full Changelog](4.0.1...4.0.2)
As defined in
Table 164 – Entries common to all annotation dictionaries
, the/Border
Array consists of NumberObjects. Previously, pypdf used NameObject which is wrong.The previous version caused a warning in the class NameObject method renumber "Incorrect first char in NameObject:({self})" line 592 _base.py (pypdf.generic)
Fixes #2444