Tincture.PDF.Accessibility (Tincture v0.3.2)

Copy Markdown View Source

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

Tagging a document is a claim: the catalog carries /MarkInfo, and the XMP metadata carries pdfuaid:part. A reader that finds structure trusts it, and a figure with no alternative text is then worse than an untagged one — the reader announces an element it cannot describe, and the person using it knows only that something is there.

So the same rule applies as for PDF/A: Tincture.export/2 refuses to write a claim the document does not meet. See Tincture.PDF.Archival for the archival half.

What is checked

  • a :figure with no :alt (clause 7.3);
  • a link annotation outside the structure tree, or nested in an element other than :link (clause 7.18.5);
  • a link annotation with no :contents (clause 7.18.5).

Clause numbers are read from veraPDF's validation profiles rather than recalled.

What this can and cannot tell you

This is not a conformance check. PDF/UA has requirements no library can settle for you — whether a heading level is the right one, whether reading order matches intent, whether an alternative text is accurate rather than merely present. Tincture checks the ones that are structural and therefore visible to it. Validate the output:

verapdf --flavour ua1 out.pdf

and, because it applies checks veraPDF does not, PAC.

Summary

Functions

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

Every PDF/UA 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/UA violation Tincture can detect in this document.

Returns [] for an untagged document, since nothing is being claimed.