Files
KenM76andClaude Opus 5.5 dffe6dd703 fix(edit, a11y): Q inside a text object restores the text matrices, as the renderer does
Inside a text object q/Q save and restore Tm and Tlm too (ISO 32000-2
§9.4.1, as corrected by the PDF Association's erratum,
pdf-association/pdf-issues #368). The renderer's saved state already
holds both. The text-editing interpreter and the heading detector kept
them across Q: text after Q was listed (and, once edited, moved) where
the q ... Q block left the pen, and a word continued after Q was split
("Chap ter One"). Both saved stacks now hold the two matrices.

Tests: pdfcraft-edit and pdfcraft-a11y
tests::q_inside_a_text_object_restores_the_text_matrices. Reverting
the edit fix puts the first case at y = 600, not 700; restoring only Tm
puts the T* case at 586, not 686; reverting the a11y fix reads
"Chap ter One". Each fails its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SqmHYx8FiWM5PcsoiErgp9
2026-10-26 23:24:24 -04:00
..

pdfcraft-a11y

Layer L4: accessibility (execution plan M12.3). Today: the Accessibility Checker's full check.

let report = check(&doc, &Options::default());          // 31 of 32 rules (colour contrast off)
let html = report_html(&report, "file.pdf", "2026-10-02", "en", &in_english);  // or an interface's words
  • 32 rules in 7 categories, as in Acrobat's full check: Document (permission flag, image-only, tagged, reading order, language, title, bookmarks, colour contrast), Page Content (tagged content, tagged annotations, tab order, character encoding, tagged multimedia, and four manual checks), Forms (tagged fields, descriptions), Alternate Text (figures, nested, associated with content, hides annotation, other elements), Tables (rows, cells, headers, regularity with row/column spans, summary), Lists (items, Lbl/LBody) and Headings (nesting).
  • Each result is Passed, Failed (with findings and pages), Needs manual check, or Skipped.
  • Content checks walk the page content streams (and form XObjects) tracking marked content: painting outside MCID-marked or /Artifact content is untagged.
  • Character encoding accepts a predefined non-Identity CJK CMap or an Adobe CJK character collection (GB1, CNS1, Japan1, Korea1, KR), including Identity-H/V. Unknown CMaps and foreign registries do not establish that route. This is a font-level declaration check, not validation of every ToUnicode entry or used glyph.
  • Structure checks read the structure tree through the role map; table regularity counts ColSpan/RowSpan attributes.
  • The report is a self-contained HTML page. Fixes that edit the document (language, title, tab order) live in the engine (Document::accessibility_fix).

Not yet: autotagging, the Tags/Order/Content panels, the Reading Order tool (M12.1–M12.2).