Mudrit
Guides

PDF/A Assertion

Assert PDF/A-2B conformance on the signed output — sRGB OutputIntent, pdfaid XMP, and a document /ID

Part of mudrit-pdfsign

.pdfa(PdfaLevel::A2b) asserts PDF/A-2B conformance on the signed output. It injects the structures a PDF/A-2B file must carry and marks the document as claiming the level, so an already-conformant input stays conformant through signing.

use mudrit_pdfsign::prelude::*;

let cfg = SignConfig::builder()
    .place("F", [350, 60, 560, 160])?
    .pdfa(PdfaLevel::A2b)          // assert PDF/A-2B on the output
    .build();

let signed = sign_pdf(&pdf, &signer, &cfg)?;

What it injects

StructureWhy PDF/A-2B needs it
sRGB /OutputIntentsA device-independent colour target, so colour is reproducible
pdfaid XMP metadataThe packet that declares the part + conformance level (2 / B)
Document /IDThe trailer identifier a conformant file must carry

Assertion, not conversion

.pdfa(...) asserts conformance — it injects the required structures and preserves an input that is already PDF/A-conformant. It does not convert an arbitrary PDF into PDF/A: it will not embed missing fonts, flatten transparency, or fix non-compliant colour. If the input is not already conformant graphics-wise, the output claims PDF/A-2B but a validator will still flag the underlying issues. Feed it a clean, conformant source.

Cannot combine with encryption

PDF/A forbids encryption, so .pdfa(...) cannot be combined with .encrypt(...). Choose one: a PDF/A-2B output, or a password-protected output — not both.

Validate the result

Mudrit asserts the level; it does not validate conformance. Verify the signed output with an external PDF/A validator — veraPDF is the reference tool:

verapdf --flavour 2b signed.pdf

A conformant input signed with .pdfa(PdfaLevel::A2b) passes; a non-conformant input surfaces the pre-existing issues so you can fix the source before signing.

Next

On this page