Repository navigation
Embedpdf/feature/catalog metadata - #91
Merged
Merged
Conversation
EPDFCatalog_GetMetadata returns the document's XMP packet, decoded. EPDFCatalog_SetMetadata replaces its bytes, unfiltered and marked /Type /Metadata /Subtype /XML so a save leaves them uncompressed, keeping the stream's object number; a catalog without one gets a new stream, and NULL removes /Metadata. What the packet says is the engine's to read and write: the fork moves the bytes.
A save writes the metadata stream unencoded, so XMP readers find it in the file's bytes. Upstream's CPDF_FlateEncoder decoded such a stream, then wrote its encoded bytes without the /Filter that decodes them, so a rewrite turned a compressed or hex-encoded packet into noise. It now writes the decoded bytes, without /Filter and /DecodeParms; bytes that don't decode are written as they are, filter and all.
Upstream's CPDF_Stream::WriteTo never encrypted a /Type /Metadata stream, while the file's /EncryptMetadata (true unless it says false) tells readers to decrypt it. A save of an encrypted file, rewrite or incremental, wrote its XMP in the clear and every reader decrypted it into noise. The metadata stream is now encrypted like any other; the creator gives no encryptor only to the document's metadata stream of a file that keeps it in the clear, which is the one the parser doesn't decrypt.
…ture/catalog-metadata
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.
No description provided.