Repository navigation
Paint the appearance of Ink annotations without strokes - #686
Merged
Merged
Conversation
Some producers omit /InkList and keep an Ink annotation's strokes only in its appearance stream. Decoding already read a missing /InkList as no strokes, but Core validation rejected ink without strokes, so the annotation was dropped with an import diagnostic and never drawn. Ink without strokes is now adopted when it has a source rectangle, which gives its bounds. Its normal appearance is painted on the page canvas, using /AS to pick from a state dictionary, alongside painted widget appearances. It cannot be dragged, because its appearance stays at the source rectangle. Strokes still need at least two points each, and ink without strokes or a source layout is still rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The annotation /Rect was read as a four-number array and mapped to edges by hand. It now uses the Rect FromPdfObject decoder, which keeps the source values unnormalized, so inverted rectangles still survive. The decoder stores the lower y edge as `top`. Every consumer normalizes the rectangle first, and the field documentation now says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the appearance_paint conflict by keeping main's widget/stamp split and adding stroke-less ink as its own painted case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014CdsKhWnipVvXi61jtdZCW
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.
Summary
/InkListand keep their strokes only in/APwere rejected by Core validation ("ink requires nonempty strokes with at least two points each"). They were dropped with an import diagnostic and never drawn./ASpicking from a state dictionary. It can't be dragged, because the appearance stays at the source rectangle./Rectis now read with theRectFromPdfObjectdecoder instead of a hand-mapped[f32; 4]. Every consumer normalizes the rectangle, so behaviour is unchanged.Test plan
cargo test -p pdf-annotation-core -p pdf-renderer -p pdf-web -p pdf-documentcargo clippy --workspace --all-targets -- -D warnings,cargo fmt --checkAnnotationOverlayandrender_annotation_appearances: no import diagnostics, eight appearances painted🤖 Generated with Claude Code