Add is_hidden field to Glyph and MarkedContentFrame structs for tracking Optional Content Group (OCG) visibility. When a BDC operator with /OC tag references an OCG that is OFF by default, glyphs within that marked content block receive is_hidden=true. Changes: - Glyph struct: Add is_hidden: bool field (default false) - MarkedContentFrame struct: Add is_hidden: bool field (default false) - MarkedContentStack: Add is_hidden() method to check if any frame is hidden (OR semantics: outer hidden makes all descendants hidden) - MarkedContentFrame::bdc(): Add is_hidden parameter - MarkedContentStack::push_bdc(): Add is_hidden parameter - parse_bdc(): Add default_off_ocgs parameter to check OCG visibility - Extract /OCG reference from properties dict - Set is_hidden=true if OCG is in the OFF set - emit_glyph(): Add is_hidden parameter and pass to Glyph::new() - Add comprehensive tests for OCG functionality Per bead pdftract-1q19p acceptance criteria: - BDC /OC with OCG in default-OFF: glyphs have is_hidden=true - BDC /OC with OCG not in OFF: glyphs have is_hidden=false - Nested OCs with outer hidden: all inner glyphs hidden - No /OCProperties: no glyphs marked hidden Closes: pdftract-1q19p Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| benches | ||
| src | ||
| tests | ||
| build.rs | ||
| Cargo.toml | ||
| pdftract-cli.cdx.json | ||