mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-20 11:08:46 +00:00
Extends the form-/BBox clip from the previous commit: a page (or a form) can clip with a plain content-stream re/W/n too (ISO 32000-2 §8.5.4), not only through a form's /BBox. The renderer already honours both; Office export honoured neither until the previous commit, and still missed this one. Ts gains a clip field (the active rectangular clip, page space), tracked by the existing q/Q save/restore (Ts already saves and restores through there, so the clip needs no extra plumbing for that). reading_lines recognizes the re ... W/W* ... n idiom and narrows the clip when it completes; a form drawn inside an active clip inherits it, on top of its own /BBox. text_lines/text_blocks (the interactive editor) call the same interpret() but consume its Shown records through their own separate loop in text_lines_in, which never looks at state.clip -- this stays scoped to reading_lines/reading_blocks (Office export, and whatever else reads a page the way a reader sees it), not editing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>