Commit Graph
17 Commits
Author SHA1 Message Date
bflatastic b75ca7539d Merge #6504: M5: comments without an appearance read style values given by reference, and a callout without /RD is drawn (view.render-annotation-appearances)
# Conflicts:
#	crates/annot/src/draw.rs
#	parity/acrobat-features.toml
2026-11-09 08:14:50 +07:00
mtlcl410 cb3d7e2997 Merge remote-tracking branch 'upstream/main' into lane3-6504
# Conflicts:
#	crates/annot/src/draw.rs
2026-11-09 03:24:27 +08:00
mtlcl410 356e8f0ba0 Merge remote-tracking branch 'upstream/main' into float-6366
# Conflicts:
#	crates/annot/src/draw.rs
#	crates/annot/src/tests.rs
2026-11-09 03:13:30 +08:00
mtlcl410andClaude Opus 5.5 9f7475c97c Merge upstream/main into fix/markup-quads-outside-rect
view.render-annotation-appearances: main's appearance builder now takes the document and draws
only the usable /QuadPoints quads (resolved, malformed ones skipped). The markup reach reads the
same quads, so an indirect or partly malformed /QuadPoints that is drawn also widens the box;
the far-off-page test quads move from 1e308 (past the PDF real range, never drawn) to 1e30.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA
2026-11-09 02:59:30 +08:00
BFlat 43f24aa169 Draw Thai in Fill & Sign, text boxes, form fields, headers, footers and watermarks (#6632)
Refs #2354. Thai typed into these tools is shaped and drawn from the Thai face through Add text's writer (now pdfcraft_fonts::shaped_text), searchable and copyable, instead of being written as ?????; a build without a Thai face refuses it with a message.
2026-11-09 02:56:34 +08:00
mtlcl410 aa45114740 Merge remote-tracking branch 'upstream/main' into lane3-6504
# Conflicts:
#	crates/annot/src/appearance.rs
#	crates/annot/src/draw.rs
#	crates/annot/src/info.rs
#	crates/annot/src/modify.rs
2026-11-09 02:29:36 +08:00
mtlcl410andClaude Opus 5.5 1015a51645 M5: a widened comment box takes in squiggle peaks, ink curve bulges, line captions and strokes reaching onto the page; a redraw reads only the comment's page (view.render-annotation-appearances)
- Text markup reaches past its quads by half its line width, and a squiggle by its peaks over a
  low quad; the drawing and the reach share the stroke sizes.
- Ink takes in the turning points of its smooth curve (cubic extrema), not only its points.
- A line takes in its caption's box and the caption tick.
- Points off the page whose strokes reach onto it widen the box as far as the page shows.
- page_box_listing reads the page /P names when that page lists the comment (ISO 32000-2
  §12.5.2: one page lists an annotation), inheriting its boxes up its /Parent chain, before
  walking the page tree.
- AppearanceCache entries carry the crop they were drawn for, so a changed crop box redraws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA
2026-11-08 11:44:01 +08:00
mtlcl410andClaude Opus 5.5 98f163652a M5: lines, polylines, polygons and ink whose points reach past their Rect are drawn through them (view.render-annotation-appearances)
The box a comment without an appearance is drawn in now takes in the
points it is drawn through: /L and its leader lines (ISO 32000-2
§12.5.6.7, Table 178), /Vertices (§12.5.6.9, Table 181) and /InkList
(§12.5.6.13, Table 185), as text markup already did with /QuadPoints.
Once a point lies outside /Rect, the box also takes in half the
border width, line endings and cloudy borders, up to the crop box. A
/Rect that holds every point is kept as written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA
2026-11-08 06:42:51 +08:00
Josias Eli Rodriguez 65ebdab392 redact, annot: usable quad values on the f32 grid; appearances resolve indirect quads
Review round on #6525 (CodeRabbit, plus eliets2's first-pass finding):

- usable_quads returns usable values on the f32 grid, so readers folding
  f32 and f64 agree on the numbers as well as on the usable set
  (67108869 is 67108872 for every reader). New geom test pins it.
- The end-to-end redact agreement test gains the 4e38 case.
- Appearance drawing read /QuadPoints off the raw dictionary, dropping an
  indirect array or indirect entries the other readers keep.
  appearance::build now takes the document and resolves both, as redact's
  reader does; the restyle probes pass the document they already hold.
  New test pins both indirect shapes against the direct output.
- One shipped test block reformatted (rustfmt).

Drafted with AI assistance; verified by the contributor, fail-before
included.
2026-11-07 05:58:15 -06:00
mtlcl410andClaude Opus 5.5 6a238f9fd7 M5: finding a referenced object too large to copy is charged to the budgets (view.render-annotation-appearances)
A referenced object rejected as over the per-annotation budget was walked
up to that budget and charged nothing, so many annotations (or many
references in one annotation) pointing at the same oversized nested array
each walked it again, and PASS_BUDGET did not bound the work. The walk is
now charged to the annotation's budget and through it to the pass, and a
spent budget follows no further references.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
2026-11-07 14:01:34 +08:00
mtlcl410andClaude Opus 5.5 b5e3de67fb M5: properties and edits read referenced colours as drawn; following references is bounded per display pass (view.render-annotation-appearances)
props() reads the whole annotation with references followed, so an
indirect /C or /IC (ISO 32000-2 7.3.10) shows its colour, and
"restylable" and the set_style / set_fill / set_part_opacity checks use
the same build and fallback as the display (draw::can_draw), so such a
comment can be restyled.

Following references now counts every value copied, inner arrays and
dictionaries included, and one display pass copies at most 4M values in
all, so an object many annotations point at is not copied for each of
them without bound. A cached appearance keeps what storing it needs
(the undrawable character and a note's /Rect), so a cache hit follows
no references at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
2026-11-07 12:51:22 +08:00
mtlcl410andClaude Opus 5.5 4bbd3a2626 M5: an indirect value the builder can't draw keeps the plain drawing (view.render-annotation-appearances)
Following references can turn up a value the appearance builder leaves
alone, such as a cloudy /BE on a square. The comment then keeps the
drawing made without the references followed, instead of none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
2026-11-07 12:01:00 +08:00
mtlcl410andClaude Opus 5.5 e69b433156 M5: comments without an appearance read style values given by reference, and a callout without /RD is drawn (view.render-annotation-appearances)
Any value may be an indirect object (ISO 32000-2 §7.3.10). The appearance
builder read only direct values, so a border style dictionary given as
`/BS 5 0 R` (Table 168) was ignored and the border drawn 1 pt solid. The
display copy, a redraw, the properties and a new width now read the
annotation with its style references followed (bounded in depth and in
copied values; links such as /P and /Popup and streams stay references).
A new width keeps an indirect /BS's other entries instead of dropping them.

/RD is optional (Table 177): a FreeText callout without it now has its
text box at /Rect and is drawn, where it was not drawn at all.

PDFBOX-4515 (annotations-2.0-without-AP).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
2026-11-07 11:56:24 +08:00
mtlcl410andClaude Opus 5.5 734bff509a M5: a text markup's widened box stops at the crop box and the quad cap; the edit path saves it (view.render-annotation-appearances)
- The widened appearance box and /Rect reach the /QuadPoints only as far
  as the page's visible region (crop box within media box, ISO 32000-2
  §14.11.2), never shrink /Rect, and are not widened at all by quads
  wholly off the page or by more than MAX_MARKUP_QUADS (10,000)
  quadrilaterals (counted before the numbers are read).
- One /Rect normalisation (normalised_rect) for appearance_context and the
  reach; markup_reach takes the normalised /Rect and the page box, and
  apply_appearance takes the saved /Rect from the built /BBox
  (widened_rect) instead of computing the reach a second time.
- Tests: the restyle (set_appearance) path saves the widened /Rect, stops
  at the page and keeps a fitting /Rect as written; a markup with its own
  /AP and a non-markup subtype are not widened; crop box and cap cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 07:22:15 +08:00
mtlcl410andClaude Opus 5.5 bf5bfbf707 M5: a text markup whose QuadPoints reach past its Rect is drawn over them (view.render-annotation-appearances)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
2026-11-06 08:53:15 +08:00
Dylan M. Taylor 7d1ed99f51 Refactor annot for strict Clippy checks 2026-10-27 23:12:50 +00:00
aiongg 5ce4d24412 refactor(annot): split lib.rs into src/
New modules: types, lookup, create, modify, draw, info.
2026-10-26 22:18:50 +00:00