BUG: Do not fail on choice field without /Opt key#3540
Merged
stefan6419846 merged 4 commits intopy-pdf:mainfrom Dec 1, 2025
Merged
BUG: Do not fail on choice field without /Opt key#3540stefan6419846 merged 4 commits intopy-pdf:mainfrom
stefan6419846 merged 4 commits intopy-pdf:mainfrom
Conversation
Closes py-pdf#2838 According to the PDF 2.0 specification, the `/Opt` key is not required for choice fields
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3540 +/- ##
==========================================
- Coverage 97.16% 97.16% -0.01%
==========================================
Files 57 57
Lines 9809 9808 -1
Branches 1781 1781
==========================================
- Hits 9531 9530 -1
Misses 167 167
Partials 111 111 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
For these cases, we regularly use a local copy downloaded from a GitHub comment link as we cannot safely ship the file with pypdf directly in these cases. Feel free to use the following link: Musterservicevertrag-HNRAGB_Okt2022-Blanko.pdf |
stefan6419846
added a commit
that referenced
this pull request
Dec 7, 2025
## What's new ### Performance Improvements (PI) - Optimize loop for layout mode text extraction (#3543) by @FelipeErmeson ### Bug Fixes (BUG) - Do not fail on choice field without /Opt key (#3540) by @jhuber-de ### Documentation (DOC) - Document possible issues with merge_page and clipping (#3546) by @stefan6419846 - Add some notes about library security (#3545) by @stefan6419846 ### Maintenance (MAINT) - Use CORE_FONT_METRICS for widths where possible (#3526) by @PJBrs [Full Changelog](6.4.0...6.4.1)
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 PR fixes a issue (#2838) with reading of choice fields that are missing the optinal
/Optkey.