Tincture.PDF.Archival (Tincture v0.1.0)

Copy Markdown View Source

Checks a document against the PDF/A rules Tincture can see.

Tincture.set_pdf_a/2 writes a conformance claim into the file's metadata. That is an assertion, not a request: a document saying pdfaid:conformance while using a font it does not embed is lying about itself, and nobody finds out until a retention audit years later. A false claim is worse than no claim, so Tincture.export/2 refuses to produce one.

What this can and cannot tell you

Everything checked here was confirmed against veraPDF rather than read off a specification, and each violation names the clause it breaks.

It is still not a conformance check. Tincture sees the document it built, not the file a validator sees, and PDF/A has requirements no library can settle on your behalf. Passing these checks means "nothing Tincture knows of is wrong", which is a much smaller claim than "this is PDF/A". Validate the output:

verapdf --flavour 2b out.pdf

What is allowed that you might expect not to be

Checkboxes, radio buttons and links are fine. They were not always: links lacked the /F key every annotation needs, and /NeedAppearances was set whenever a document had any form field at all. Both were fixed rather than forbidden, because a rule that bans working features is a bug in the rule.

Summary

Functions

A human-readable summary of the violations, for an error message.

Every PDF/A violation Tincture can detect in this document.

Types

violation()

@type violation() :: %{rule: atom(), clause: String.t(), message: String.t()}

Functions

describe(violations)

@spec describe([violation()]) :: String.t()

A human-readable summary of the violations, for an error message.

violations(pdf)

@spec violations(Tincture.PDF.t()) :: [violation()]

Every PDF/A violation Tincture can detect in this document.

Returns [] for a document that declares no level, since there is then nothing being claimed.