test(pdf): pin the object-stream page rewrite - #846
Merged
Conversation
The one case Phase 1 left open. A page dictionary compressed into an object stream is rewritten uncompressed in the appended section and the newer type-1 entry wins, which is what modern producers make the common case. No code change: it already worked, and now says so. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018e3PEzyU2oAFSzsEoWsSmz
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.
🤖 Generated with Claude Code
Closes the one gap #845 left open, and the last thing
docs/design/pdf-annotation.mdlisted as owed before Phase 2.A highlight always rewrites the page dictionary, and modern producers put page dictionaries in object streams — so if that case were broken, every annotation on a contemporary PDF would be.
opendocument-app-website.pdfis exactly that shape (xref stream, page objects compressed), and nothing had tested it.It already worked. No code change here, only the test that says so:
is_compressed()before the rewrite andis_used()after — the newer type-1 entry overriding the older type-2 one is the actual mechanism under testExternally on the same output:
qpdf --checkclean, and CoreGraphics renders page 1 rotated. Phase 1 had only validated a classic-table file that way, so the type-2 → type-1 override is genuinely new evidence.The doc drops the "still untested" note and records what the tests now cover.
37 writer/parser tests pass.
No consumer-visible change, so no changelog entry.