Turbo Puffin
All posts

PDF/UA validator: how to check a PDF for PDF/UA from the command line or an API

Three ways to validate PDF/UA-1 and PDF/UA-2: veraPDF on your own machine, PAC on the desktop, and an API call from code.

A PDF/UA validator reads a PDF and lists every place it breaks the PDF/UA accessibility standard, each with a rule ID. The open source veraPDF does it from the command line. Fare's PDF/UA validator does it with one HTTP call, POST https://api.fare.dev/v1/pdf/validate, and returns veraPDF's rule IDs as JSON.

Below: what the validators check, how to run each one, and which fits where.

What does a PDF/UA validator check?

PDF/UA (ISO 14289) is the standard for accessible PDFs. Part 1 dates from 2014 and part 2 from 2024. A validator tests the rules a machine can test: content is tagged, figures have alternative text, the document has a title and language, fonts are embedded, and the metadata says which PDF/UA part the file follows.

It can't tell you whether the alt text is any good or whether the reading order makes sense. That still needs a person. A clean report means the file passed every rule a machine can check, not that it's fully accessible.

How do I validate PDF/UA with veraPDF?

veraPDF is the open source validator, with a GUI and a command line tool. It ships a validation profile for each standard. ua1 is PDF/UA-1, ua2 is PDF/UA-2, and verapdf -l lists them all.

Pick a profile with -f (or --flavour), and the report format with --format:

Shell
verapdf -f ua1 --format json report.pdf

Leave out -f and veraPDF reads the file's metadata and picks the profile itself. The default report format is XML. text, html and json are the others.

veraPDF runs on your own machine. That suits batch jobs, CI and files that can't leave your network. You install and update it yourself.

How do I check PDF/UA with PAC?

PAC, the PDF Accessibility Checker, is a free desktop app. You drag a file onto it and get a summary or a detailed report. PAC says it "can check many PDF/UA and WCAG requirements at the touch of a button," and its screen reader preview shows what a screen reader will read, in order. PAC 2026 adds AI-assisted checks.

PAC is built for a person checking documents one at a time, not for code.

How do I validate PDF/UA from an API?

Send the PDF as the request body to Fare's validator:

Shell
curl -X POST "https://api.fare.dev/v1/pdf/validate?profile=ua1" \
  -H "X-API-Key: $FARE_KEY" -H "Content-Type: application/pdf" \
  --data-binary @report.pdf

The response lists the failed rules and a message for each:

JSON
{
  "profile": "PDF/UA-1",
  "compliant": false,
  "failed_rules": ["7.1-t03", "7.3-t01"],
  "violations": [
    {"rule": "7.1-t03", "message": "Content is neither tagged nor marked as an Artifact."},
    {"rule": "7.3-t01", "message": "Figure has no Alt or ActualText."}
  ],
  "rule_set": "veraPDF validation profiles"
}

profile takes ua1 or ua2. Leave it out and Fare uses the part the file claims in its XMP metadata, or PDF/UA-1 if it claims none. Files can be up to 50 MB.

The rule IDs match the veraPDF validation profiles, so you can compare a Fare report with a local veraPDF run line by line. The engine is our own, written in Rust, and it passes all 435 files of the open veraPDF PDF/UA test corpus. Fare isn't part of the veraPDF project.

Each successful call is billed, and failed calls never are. There's nothing to install.

Which PDF/UA validator should I use?

veraPDFPACFare
RunsOn your machine (CLI, GUI)On your desktopHosted API and MCP server
ChecksPDF/UA-1, PDF/UA-2, PDF/APDF/UA and WCAGPDF/UA-1, PDF/UA-2
OutputXML, JSON, HTML, textSummary or detailed reportJSON with veraPDF rule IDs
Best forBatch jobs and CI you host yourselfOne person checking one fileApps, pipelines and AI agents
CostOpen sourceFreePer successful call

Use PAC to look at a file by hand. Use veraPDF when you want it all on your own servers. Use Fare when you'd rather not install and update a validator, or when an agent needs to check a PDF on its own.

Can an AI agent validate a PDF?

Yes. Fare runs an MCP server at https://api.fare.dev/mcp. Its validate_pdf_ua tool takes a public url or a base64 PDF and returns the same report as the REST call, billed the same way. To add it to Claude Code:

Shell
claude mcp add --transport http fare https://api.fare.dev/mcp --header "Authorization: Bearer $FARE_KEY"

What do I do when the validator finds problems?

Fix them, then validate again. A validator only reports. To get a fixed file back, use Remediate, our PDF fixer. It tags the content, sets the reading order, title and language, and writes the image descriptions, then checks the result. Our comparison of PDF accessibility APIs covers the other fixers.

If the only error left is the missing PDF/UA identifier, see PDF/UA identifier missing.

FAQ

Is there a hosted veraPDF?

veraPDF itself is software you run. Fare is a hosted validator whose rule IDs match veraPDF's profiles, but it's a separate engine and isn't affiliated with the veraPDF project.

What's the difference between PDF/UA-1 and PDF/UA-2?

They're two parts of ISO 14289, published in 2014 and 2024, and they have different rule sets. Validate against the part the file was made for. Both veraPDF and Fare read the part from the file's metadata if you don't choose one.

Does passing PDF/UA mean a PDF meets WCAG?

Not on its own. Machine checks can't judge alt text or reading order, and WCAG asks for both to be right. Plan for a human review of anything important.

Read the docs