mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-10 13:01:29 +00:00
#2539 review: the scrub removes the catalog's XMP packet whole when it holds the removed text, and with it the file's PDF/A and PDF/UA claims, which Report didn't say. The identification (pdfaid part, conformance, amd, rev; pdfuaid part, rev) is now read by namespace (roxmltree, already in the build through pdfcraft-xfa), each value kept only when it is the short code it must be and doesn't hold the removed text (one-character codes always), and written back in a packet holding nothing else, with a fixed pdfuaid extension schema under PDF/A-1 to -3 (left out, with the PDF/UA claim, if the redacted words are among its words). Report::identification says, per standard, None / Kept / Lost; the engine passes it on as EditNotice::RedactionIdentification, the Apply notification says it after the count, and redact_apply returns identification { pdfa, pdfua }. Tests (redact): the_identification_of_a_removed_packet_is_written_back, a_packet_without_identification_is_only_removed, an_identification_that_cannot_be_kept_is_reported_lost, unsearched_text_keeps_only_one_character_codes, the_extension_schema_is_left_out_when_it_uses_a_redacted_word; engine applied_redactions_report_the_pdfa_identification_written_back; automation redact_apply_reports_the_identification_written_back; ui-egui applying_says_the_pdfa_identification_was_written_back. With the write-back replaced by "nothing kept", the redact tests fail (Kept expected, None found); with the notice not pushed, the engine, automation and UI tests fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv