Skip to content

Packs / accessibility-public

pdf-accessibility-check

Check a PDF for the basics of an accessible document: tagged, language set, title shown, real text (not a scan)

Install

logicpacks pack use accessibility-public/pdf-accessibility-check
get_pack accessibility-public/pdf-accessibility-check

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: local-pythonverapdf
  • Checks: 2 in outcome/checks.yaml
  • Code: pdf_a11y.py
  • Tools: python3, pdftotext

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

A pass/fail list for a PDF: tagged (MarkInfo/StructTreeRoot), document language, title + DisplayDocTitle, tab order follows structure, extractable text (not image-only), from a stdlib scan plus pdftotext.

Verified by: Generated tagged fixture passes all 5 checks; untagged fixture fails tagged/lang/title/tab order and passes text.

Steps

  1. Run python3 code/pdf_a11y.py doc.pdf.
  2. Fix at the source (Word/InDesign: export as tagged PDF with title and language), not by patching the PDF.
  3. For full PDF/UA use veraPDF or PAC (free) and a screen-reader pass.

Edge cases

  • Compressed object streams can hide catalog keys; the script inflates FlateDecode streams it can read.
  • Image-only pages are detected by empty pdftotext output; OCR (tesseract/ocrmypdf) is the fix.

Don'ts

  • Don't claim WCAG conformance from automated checks alone; automated tools catch roughly a third of issues, so do a manual keyboard and screen-reader pass too.