BUG: Fix XMP handling dropping indirect references#3392
Merged
stefan6419846 merged 2 commits intopy-pdf:mainfrom Jul 22, 2025
Merged
BUG: Fix XMP handling dropping indirect references#3392stefan6419846 merged 2 commits intopy-pdf:mainfrom
stefan6419846 merged 2 commits intopy-pdf:mainfrom
Conversation
Closes py-pdf#3391. According to table 29 of the PDF 2.0 specification, the Metadata stream inside the catalog dictionary should be an indirect reference. The old code would inline the content stream into the catalog dictionary, making the file unreadable in some applications like some versions of Adobe Acrobat.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3392 +/- ##
==========================================
+ Coverage 96.91% 96.94% +0.03%
==========================================
Files 55 55
Lines 9324 9333 +9
Branches 1706 1708 +2
==========================================
+ Hits 9036 9048 +12
+ Misses 172 170 -2
+ Partials 116 115 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
stefan6419846
added a commit
that referenced
this pull request
Jul 27, 2025
## What's new ### New Features (ENH) - Automatically preserve links in added pages (#3298) by @larsga - Allow writing/updating all properties of an embedded file (#3374) by @Arya-A-Nair ### Bug Fixes (BUG) - Fix XMP handling dropping indirect references (#3392) by @stefan6419846 ### Robustness (ROB) - Deal with DecodeParms being empty list (#3388) by @stefan6419846 ### Documentation (DOC) - Document how to read and modify XMP metadata (#3383) by @stefan6419846 [Full Changelog](5.8.0...5.9.0)
OpenNingia
pushed a commit
to OpenNingia/pypdf
that referenced
this pull request
Oct 23, 2025
## What's new ### New Features (ENH) - Automatically preserve links in added pages (py-pdf#3298) by @larsga - Allow writing/updating all properties of an embedded file (py-pdf#3374) by @Arya-A-Nair ### Bug Fixes (BUG) - Fix XMP handling dropping indirect references (py-pdf#3392) by @stefan6419846 ### Robustness (ROB) - Deal with DecodeParms being empty list (py-pdf#3388) by @stefan6419846 ### Documentation (DOC) - Document how to read and modify XMP metadata (py-pdf#3383) by @stefan6419846 [Full Changelog](py-pdf/pypdf@5.8.0...5.9.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.
Closes #3391.
According to table 29 of the PDF 2.0 specification, the Metadata stream inside the catalog dictionary should be an indirect reference. The old code would inline the content stream into the catalog dictionary, making the file unreadable in some applications like some versions of Adobe Acrobat.