pdf-accessibility-checker
БесплатноБез исполняемых скриптовНе проверенUse when customer-facing PDFs must meet PDF/UA (Section 508, EU accessibility rules, public tenders) and each file must be proven tagged before release…
от testland★ 18 звёзд на GitHubОб этом скилле
pdf-accessibility-checker
Per the [WCAG 2.1 spec], "Text alternatives" + "Structured information that can be programmatically determined" + "Language identification"
- "Proper document organization" apply to PDFs. The PDF/UA standard (ISO 14289) operationalizes these into concrete file-level requirements: Tagged PDF, role mapping, Alt text, reading order, Lang metadata.
When to use
- Producing PDFs in regulated industries (US Section 508, EU Directive 2016/2102, accessible-by-default policies).
- Public-sector tenders that require PDF/UA compliance.
- Pre-deployment gate: every customer-facing PDF passes the accessibility check before release.
Step 1 - Pick a checker
| Tool | Strength |
|---|---|
| veraPDF (open source) | PDF/UA-1 + PDF/A validation; CI-friendly CLI |
| PAC (PDF Accessibility Checker) by axes4 | UI-first; comprehensive Matterhorn Protocol coverage |
| pdfix | Commercial; auto-tagging fixes |
| Adobe Acrobat Pro Accessibility Check | Industry default; manual-review-friendly |
For CI, veraPDF is the default open-source choice.
Step 2 - Install veraPDF
# Download installer
curl -L -o verapdf.zip https://software.verapdf.org/releases/1.30/verapdf-greenfield-1.30.2-installer.zip
unzip verapdf.zip
# The zip ships an IzPack installer, not a ready-to-run binary
verapdf-greenfield-1.30.2/verapdf-install ./auto-install.xml
<install-dir>/bin/verapdf --version
Current release index (1.30.2 as of this writing):
software.verapdf.org/releases.
The headless verapdf-install ./auto-install.xml form and the
bin/ layout are per
docs.verapdf.org/install.
Step 3 - Run conformance check
verapdf --flavour ua1 --format json out.pdf > vera-report.json
Exit codes: 0 = conformant, 1 = non-conformant, 2 = parse error.
Step 4 - Parse and assert
import json, subprocess
def test_pdf_passes_pdf_ua_1():
result = subprocess.run(
["verapdf", "--flavour", "ua1", "--format", "json", "out.pdf"],
capture_output=True, text=True,
)
report = json.loads(result.stdout)
# Iterate jobs[0].validationResult
job = report["report"]["jobs"][0]
failed = job["validationResult"]["details"]["failedRules"]
assert failed == 0, f"PDF/UA validation failed: {job['validationResult']['details']}"
Step 5 - Verify tagged PDF (StructTreeRoot)
A PDF is "tagged" if its catalog has a StructTreeRoot and
MarkInfo /Marked true. Without these, screen readers cannot read
the document semantically.
import pikepdf
def test_pdf_is_tagged():
pdf = pikepdf.open("out.pdf")
catalog = pdf.Root
assert "/StructTreeRoot" in catalog, "PDF lacks StructTreeRoot (untagged)"
mark_info = catalog.get("/MarkInfo", {})
# Use bool(), not `is True`: pikepdf can return a pikepdf.Object wrapper
# rather than the singleton Python True, so `is True` is always False
# even when /Marked is set (per [pikepdf objects]).
assert bool(mark_info.get("/Marked", False)), "PDF MarkInfo /Marked is false"
Step 6 - Verify document title + language metadata
Per the [WCAG 2.1 spec], language identification + descriptive title are required.
def test_pdf_has_title_and_lang():
pdf = pikepdf.open("out.pdf")
info = pdf.docinfo
title = info.get("/Title")
assert title and str(title).strip(), "PDF has no /Info /Title"
lang = pdf.Root.get("/Lang")
assert lang and str(lang) in ("en", "en-US", "en-GB", "de", "fr"), f"PDF /Lang invalid: {lang}"
Step 7 - Verify image Alt text presence
def test_all_images_have_alt():
pdf = pikepdf.open("out.pdf")
structure_root = pdf.Root["/StructTreeRoot"]
# The structure tree is NESTED: each element's /K can hold child
# elements to arbitrary depth, so /Figure tags live below /Document,
# /Sect, /P, etc. A top-level-only scan misses nested figures and
# passes vacuously. Walk every /K recursively. Each /Figure must carry
# an /Alt (or /ActualText) per [WCAG PDF1].
untagged_images = []
def walk(node):
if isinstance(node, pikepdf.Array):
for child in node:
walk(child)
return
if not isinstance(node, pikepdf.Dictionary):
return # marked-content id (int) or other leaf
if node.get("/S") == "/Figure":
alt = node.get("/Alt")
if not alt or not str(alt).strip():
untagged_images.append(node)
kids = node.get("/K")
if kids is not None:
walk(kids)
walk(structure_root.get("/K"))
assert untagged_images == [], f"Images without /Alt: {len(untagged_images)}"
Step 8 - Reading order verification
Reading order determined by structure-tree DFS. Verify the generated structure puts content in the order a human reader would expect:
def test_reading_order_matches_visual_order():
Установить pdf-accessibility-checker в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл pdf-accessibility-checker?
Use when customer-facing PDFs must meet PDF/UA (Section 508, EU accessibility rules, public tenders) and each file must be proven tagged before release. Checks structure tags, alt text, reading order, language and title with veraPDF, PAC or similar, mapped to WCAG PDF techniques.
Как установить скилл pdf-accessibility-checker?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pdf-accessibility-checker запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic