Skip to main content

pdfrum_doc/pdfa/
mod.rs

1//! PDF/A conformance checking (ISO 19005): what a document fails, and why.
2//!
3//! # Reporting and repair policy
4//!
5//! [`check`] reports what a document fails; it rewrites nothing. [`Policy`]
6//! and its outcome types describe what a caller will accept in exchange for
7//! conformance, and [`packet`](xmp_packet) serializes the XMP a converted
8//! file carries. Applying a repair belongs to the writer.
9//!
10//! The checker is cross-examined against veraPDF:
11//! `crates/pdfrum/tests/pdfa_oracle.rs` scores every check against it exactly
12//! as the conformance board scores rendering against `pdfium_test`.
13//!
14//! # What a failure is
15//!
16//! A [`Violation`] names three things: the [`Clause`] of ISO 19005 it breaks,
17//! the [`Subject`] in the file that breaks it, and a short human sentence.
18//! The clause is an enum rather than a formatted string because the whole
19//! point of a report is that a caller can act on it — count by clause, filter
20//! to the ones a converter can repair, or map to another vocabulary. A report
21//! that can only be printed is worth much less than one that can be matched.
22//!
23//! # Scope
24//!
25//! [`Level::A1b`] and [`Level::A2b`], the two *basic* conformance levels. The
26//! `a` levels (A-1a, A-2a, A-3a) additionally require a tagged logical
27//! structure tree with a defined reading order, which is a different kind of
28//! claim resting on a structure model this engine does not yet have; they are
29//! absent by decision, not by oversight, and [`Level`] has no variant for
30//! them so a caller cannot ask for a check that would silently be weaker than
31//! its name.
32
33mod check;
34mod policy;
35mod report;
36mod xmp;
37mod xmp_write;
38
39pub use check::check;
40pub use policy::{Compromise, Concession, Conversion, Dpi, Policy, RasterCause, Refusal};
41pub use report::{Clause, Level, Report, Subject, Violation};
42pub use xmp_write::{InfoFields, packet as xmp_packet};