{"slug":"remediate-pdf","title":"remediate-pdf","summary":"Make existing documents accessible with the Nutrient Accessibility API: auto-tag PDFs with PDF/UA semantic structure (headings, lists, tables, reading order) and validate PDFs against PDF/UA-1 with a JSON report of every failed check. Routes Word, image, and scanned files through","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-11-29T00:42:57.721785Z","repo":{"url":"https://github.com/PSPDFKit-labs/nutrient-skills","stars":18,"forks":1,"license":null,"updatedAt":"2026-11-26T02:45:46Z"},"bodyHtml":"<hr>\n<h2>name: remediate-pdf\ndescription: &gt;-\nMake existing documents accessible with the Nutrient Accessibility API: auto-tag PDFs with\nPDF/UA semantic structure (headings, lists, tables, reading order) and validate PDFs against\nPDF/UA-1 with a JSON report of every failed check. Routes Word, image, and scanned files through\nconversion and OCR first. Use when the user wants to make a PDF accessible, auto-tag for screen\nreaders, remediate for PDF/UA as part of Section 508 work, check whether a PDF passes PDF/UA, or\nmake a Word file or scan accessible. Triggers include auto-tag PDF, make this PDF accessible,\ntag for screen readers, remediate accessibility, PDF/UA remediation, validate PDF/UA, or check\nPDF/UA. Hand edits to reading order, alt text, or tags go to Accessibility Studio. To generate a\nNEW accessible PDF from Markdown or HTML, use make-pdf instead. Converting to PDF/A, merging, or\nsigning go to document-processor-api.\nlicense: MIT\nmetadata:\nauthor: nutrient-sdk\nversion: \"1.1\"\nhomepage: \"https://www.nutrient.io/api/accessibility-api/\"\nrepository: \"https://github.com/PSPDFKit-labs/nutrient-skills\"\ncompatibility: \"Requires Python 3.10+, uv, and internet. Works with Claude Code, Codex CLI, Gemini CLI, OpenCode, Cursor, Windsurf, GitHub Copilot, Amp, or any Agent Skills-compatible product.\"\nshort-description: \"Make existing documents accessible: auto-tag and validate PDF/UA via the Nutrient Accessibility API\"</h2>\n<h1>Nutrient Remediate PDF</h1>\n<p>Make an existing document accessible with the Nutrient Accessibility API:</p>\n<ul>\n<li><strong>Auto-tag</strong> a PDF with PDF/UA semantic structure: headings (H1–H6), lists, tables (TR/TD/TH),\nreading order, and artifact marking. Writes a tagged copy; the original is untouched.</li>\n<li><strong>Validate</strong> a PDF against PDF/UA-1. Writes the JSON report and summarizes every failed check.</li>\n</ul>\n<p>Files the Accessibility API can't take directly (Word, Excel, PowerPoint, images, scans without a\ntext layer) are converted or OCR'd first with the <code>document-processor-api</code> skill.</p>\n<h2>When to use</h2>\n<ul>\n<li>\"Make this PDF accessible\" / \"auto-tag for screen readers\" / \"tag this PDF for PDF/UA\"</li>\n<li>\"Does this PDF pass PDF/UA?\" / \"validate this PDF for accessibility\"</li>\n<li>\"Make this Word document accessible\" / \"make this scanned PDF accessible\"</li>\n<li>\"Prepare this document for Section 508\" (the tagging and PDF/UA checking steps)</li>\n</ul>\n<h2>Which path to take</h2>\n<p>For a check-only request, run <code>validate.py</code> on the supplied PDF as-is, regardless of its tags.\nUse the table when the user asks to prepare or remediate the file.</p>\n<table>\n<thead>\n<tr>\n<th>Input</th>\n<th>Path</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>PDF without tags</td>\n<td><code>autotag.py</code>, then <code>validate.py</code></td>\n</tr>\n<tr>\n<td>PDF that already has tags</td>\n<td><code>validate.py</code> first. If it fails, suggest Accessibility Studio's Repair, which keeps the existing tags. Re-tag with <code>autotag.py</code> only when the tags are unusable, and warn the user that re-tagging replaces the existing structure and alt text</td>\n</tr>\n<tr>\n<td>Scanned PDF (no text layer)</td>\n<td>OCR with <code>document-processor-api</code>'s <code>ocr.py</code>, then <code>autotag.py</code>, then <code>validate.py</code></td>\n</tr>\n<tr>\n<td>PDF with both digital text and scans</td>\n<td>Check whether the scanned pages contain text the reader needs and already have OCR. If required, OCR the missing text before tagging. Text on another page does not establish that the scanned pages are readable</td>\n</tr>\n<tr>\n<td>Word, Excel, or PowerPoint file</td>\n<td>Best: fix it in the source (heading styles, alt text, title, language) and export a tagged PDF (Word: Save as PDF with \"Document structure tags for accessibility\"), then <code>validate.py</code>. Otherwise convert with <code>document-processor-api</code>'s <code>convert.py</code>, then <code>autotag.py</code> and <code>validate.py</code></td>\n</tr>\n<tr>\n<td>Image of a document</td>\n<td><code>document-processor-api</code>'s <code>ocr.py</code>, then <code>autotag.py</code> and <code>validate.py</code></td>\n</tr>\n</tbody>\n</table>\n<p>Validate before the user publishes or shares a file. Auto-tagging is built to produce PDF/UA-1\nconformant output, but not every file passes (see Anti-patterns). Skip validation only for\ninternal drafts the user doesn't plan to publish.</p>\n<h3>OCR and conversion setup</h3>\n<p>The dashboard prompt installs <code>remediate-pdf</code> by itself. When you need OCR or conversion, install\n<code>document-processor-api</code> if the agent doesn't already have it:</p>\n<ul>\n<li>Claude Code: if the marketplace is missing, run\n<code>claude plugin marketplace add pspdfkit-labs/nutrient-skills</code>. Then run\n<code>claude plugin install nutrient-dws@nutrient-skills</code>.</li>\n<li>Skills CLI: run <code>npx skills add pspdfkit-labs/nutrient-skills --skill document-processor-api</code>\nand select the same agent.</li>\n</ul>\n<p>Find the directory containing the installed <code>document-processor-api/SKILL.md</code> and use that\ndirectory for its script paths. Its scripts read <code>NUTRIENT_API_KEY</code>. If the dashboard set only\n<code>NUTRIENT_ACCESSIBILITY_API_KEY</code>, pass that same value as <code>NUTRIENT_API_KEY</code> in the Processor\nprocess environment on a unified plan. For a legacy account with separate keys, use the\nProcessor key. Keep the values in the process environment.</p>\n<p>With <code>processor_skill_dir</code> set to the installed skill directory, run the relevant command:</p>\n<pre><code>uv run \"$processor_skill_dir/scripts/ocr.py\" --input /abs/scan.pdf --languages english --out /abs/scan-ocr.pdf\nuv run \"$processor_skill_dir/scripts/convert.py\" --input /abs/report.docx --format pdf --out /abs/report.pdf\n</code></pre>\n<h2>Disambiguation from sibling skills</h2>\n<ul>\n<li><strong>Use <code>make-pdf</code></strong> (its own plugin: <code>/plugin install make-pdf@nutrient-skills</code>) to generate a NEW\ncompliant PDF from Markdown or HTML.</li>\n<li><strong>Use <code>document-processor-api</code></strong> to convert to PDF/A, merge, sign, or produce PDF/UA as one\noutput target of a wider <code>/build</code> job. Both that skill and this one use the same auto-tagging\nengine (<code>pdf_to_pdfua</code>); this skill is the Accessibility API surface with validation.</li>\n</ul>\n<h2>Setup</h2>\n<ul>\n<li>Get an API key at <a href=\"https://dashboard.nutrient.io/\">https://dashboard.nutrient.io/</a>. On current plans, one Nutrient account and\nkey cover the Accessibility API and the Processor API.</li>\n<li>Export it as <code>NUTRIENT_ACCESSIBILITY_API_KEY</code> (the scripts also accept <code>NUTRIENT_API_KEY</code>):\n<pre><code>export NUTRIENT_ACCESSIBILITY_API_KEY=\"pdf_live_...\"\n</code></pre>\n</li>\n<li>Run the scripts by their path in this skill directory and pass <strong>absolute</strong> paths for\n<code>--input</code>, <code>--output</code>, and <code>--report</code>, so the user's files resolve from any working directory:\n<pre><code>uv run &lt;skill-dir&gt;/scripts/autotag.py --help\n</code></pre>\n</li>\n</ul>\n<h2>Operations</h2>\n<h3><code>autotag.py</code> — auto-tag a PDF</h3>\n<pre><code>uv run &lt;skill-dir&gt;/scripts/autotag.py --input /abs/doc.pdf --output /abs/doc-tagged.pdf\nuv run &lt;skill-dir&gt;/scripts/autotag.py --url https://example.com/doc.pdf --output /abs/doc-tagged.pdf\n</code></pre>\n<ul>\n<li><code>POST https://api.nutrient.io/accessibility/autotag</code>, multipart field <code>file</code>. <code>--url</code> is\ndownloaded client-side (https on port 443, public addresses only, no redirects).</li>\n<li>Writes the tagged PDF to <code>--output</code> (default <code>&lt;input-stem&gt;-tagged.pdf</code>) and prints the pages\nprocessed. Refuses to replace an existing file unless <code>--overwrite</code> is passed.</li>\n<li>Exit codes: 0 = written; 1 = error; 2 = stopped at the cost gate; 4 = no extractable text found.\nRun OCR for documents that contain scanned text. Use <code>--allow-no-text</code> for intentionally text-free PDFs.</li>\n</ul>\n<h3><code>validate.py</code> — check a PDF against PDF/UA-1</h3>\n<pre><code>uv run &lt;skill-dir&gt;/scripts/validate.py --input /abs/doc.pdf\nNUTRIENT_PDF_PASSWORD=\"...\" uv run &lt;skill-dir&gt;/scripts/validate.py --input /abs/protected.pdf --with-password\n</code></pre>\n<ul>\n<li><code>POST https://api.nutrient.io/accessibility/validate_pdfua</code>, multipart field <code>file</code>.</li>\n<li>A completed validation returns HTTP 200 whether or not the PDF passes. The script reads\n<code>isValid</code>, writes the report to <code>--report</code> (default <code>&lt;input-stem&gt;-validation.json</code>), and prints\neach failed check with its occurrences.</li>\n<li>Exit codes: 0 = passed machine validation; 3 = failed; 1 = error.\nAn incomplete or inconsistent API reply is an error and does not produce a validation verdict.</li>\n<li><code>--with-password</code> sends the password from <code>NUTRIENT_PDF_PASSWORD</code> in the\n<code>pspdfkit-pdf-password</code> header. A <code>403</code> means the password is missing or wrong, or the key isn't\nenabled for the Accessibility API.</li>\n</ul>\n<h2>Decision rules</h2>\n<ul>\n<li><strong>Cost.</strong> Auto-tagging is billed per page and validation per validation, from the account's\nmonthly usage, then the wallet (rates: <a href=\"https://www.nutrient.io/api/pricing/\">https://www.nutrient.io/api/pricing/</a>). <code>autotag.py</code>\nstops with exit 2 above <code>--confirm-over</code> pages (default 10) or when the page count is unknown,\nas with every <code>--url</code>. Tell the user the page count and re-run with <code>--yes</code> only after they\nconfirm.</li>\n<li><strong>Watermark.</strong> On the free plan, Processor output (<code>convert.py</code>, <code>ocr.py</code>) is watermarked until\nthe account adds a wallet, and auto-tagging tags the watermark as page content. Tell the user\nbefore preparing documents to publish.</li>\n<li><strong>Max file size</strong> is 150 MiB per request. For larger documents, split first with\n<code>document-processor-api</code>'s <code>split.py</code>.</li>\n<li><strong>Do not auto-retry on a 2xx response</strong>: each call is billed.</li>\n</ul>\n<h2>What a person still has to check</h2>\n<p>A pass from <code>validate.py</code> covers the machine-testable PDF/UA-1 requirements. Before calling a\ndocument accessible, ask the user to have someone check:</p>\n<ul>\n<li>that alt text describes each image (the API passes placeholder text such as \"image\")</li>\n<li>that the reading order is logical and tag types are right (for example, a heading not tagged as\na paragraph), with heading levels that make sense</li>\n<li>that table headers belong to the right cells, and link text makes sense on its own</li>\n<li>that the document title and language are correct, not just present</li>\n<li>color contrast and meaning conveyed by color alone (not checked by PDF/UA validation)</li>\n</ul>\n<h2>What the API can't do: send people to Accessibility Studio</h2>\n<p>Some fixes need a person and a visual editor, and have no API. When a validation report or the\nuser's request calls for them, point the user to Accessibility Studio in the Nutrient dashboard\n(<a href=\"https://dashboard.nutrient.io/\">https://dashboard.nutrient.io/</a>):</p>\n<ul>\n<li><strong>Repair</strong>: fix the existing tags of a failing PDF without re-tagging it.</li>\n<li><strong>Remediation</strong>: edit tag types, alternative text, actual text, and language on the page, with\none-click fixes for common structure, table, list, heading, and form issues.</li>\n<li><strong>Reading order</strong>: drag blocks into the order a screen reader should follow.</li>\n<li><strong>Placeholder alternative text</strong>: Studio's validation warns about figures whose alt text is a\nplaceholder. The API report passes placeholder text such as \"image\".</li>\n</ul>\n<p>Editing tags in Studio is free; only validation is billed. Manual edits can break conformance (for\nexample, changing the first heading from H1 to H3), so validate again after editing.</p>\n<h2>Anti-patterns</h2>\n<ul>\n<li>Do <strong>not</strong> claim WCAG, ADA, or Section 508 compliance. Section 508 requires WCAG 2.0 AA for\ndocuments; PDF/UA-1 conformance supports many of those criteria but doesn't establish\nconformance on its own. Auto-tagged files passed PDF/UA-1 validation 96.5 percent of the time\nin Nutrient's March 2026 benchmark of 3,157 files checked with veraPDF\n(<a href=\"https://www.nutrient.io/blog/pdf-ua-compliance-guide/\">https://www.nutrient.io/blog/pdf-ua-compliance-guide/</a>), so not every file passes.</li>\n<li>Do <strong>not</strong> report a pass as \"accessible\" or \"fully conformant\". Say it passed PDF/UA-1 machine\nvalidation, and list the human checks above.</li>\n<li>Do <strong>not</strong> read an HTTP 200 from validation as a pass. Check <code>isValid</code>.</li>\n<li>Do <strong>not</strong> auto-tag an image-only scan without OCR. Auto-tagging doesn't add a text layer, so\nthe result has no readable text.</li>\n<li>Do <strong>not</strong> add <code>--yes</code> by default. It skips the cost gate.</li>\n<li>Do <strong>not</strong> route PDF/A conversion, merging, or signing here — those belong to\n<code>document-processor-api</code>.</li>\n</ul>\n<h2>Security Hardening Addendum</h2>\n<ul>\n<li>Never store the API key or PDF passwords in committed files. Use process env injection at\nruntime (shell/export, secrets manager, or host env).</li>\n<li>The scripts never print the API key or PDF password, and redact both from any error output.\nThe PDF password is read only from <code>NUTRIENT_PDF_PASSWORD</code>.</li>\n<li><code>--url</code> inputs must be https on port 443 and resolve to public addresses; the address actually\nconnected to is checked again, redirects are not followed, and the download is capped at\n150 MiB and 300 seconds. The Nutrient backend never fetches the URL. Do not pass unsanitized\nuser-controlled strings to <code>--url</code>.</li>\n<li>Outputs (tagged PDFs, reports) use <code>0600</code> permissions on POSIX. On Windows, use a destination\nwith suitable access controls. The scripts never write through a destination symlink or over\nthe input, and replace an existing output only with <code>--overwrite</code>.</li>\n</ul>\n<h2>Reference map</h2>\n<ul>\n<li><code>references/accessibility-api-reference.md</code> — endpoints, request and response shapes, report\nschema, error codes, and pricing model.</li>\n<li><code>references/pdf-ua-wcag-compliance-notes.md</code> — what auto-tagging and validation cover, PDF/UA vs\nWCAG, Section 508 relationship.</li>\n<li><code>scripts/verify-pdf.py</code> — the bundled offline structural checker (the identical file ships in the\n<code>make-pdf</code> plugin; keep them in sync). Use it when no API key is available or for a free local\ncheck; <code>validate.py</code> is the authoritative PDF/UA-1 validation.</li>\n<li>Sibling <code>document-processor-api/SKILL.md</code> — conversion, OCR, splitting, the <code>/build</code> PDF/UA\noutput target, and the same underlying auto-tagging engine.</li>\n<li>The <code>make-pdf</code> skill (separate plugin: <code>make-pdf@nutrient-skills</code>) — generate NEW compliant\nPDFs from Markdown/HTML.</li>\n</ul>\n","files":[{"path":".gitignore","sizeBytes":19,"isText":false},{"path":"references/accessibility-api-reference.md","sizeBytes":6806,"isText":true},{"path":"references/pdf-ua-wcag-compliance-notes.md","sizeBytes":3417,"isText":true},{"path":"scripts/autotag.py","sizeBytes":18264,"isText":true},{"path":"scripts/test_autotag.py","sizeBytes":14850,"isText":true},{"path":"scripts/test_validate.py","sizeBytes":8817,"isText":true},{"path":"scripts/validate.py","sizeBytes":9661,"isText":true},{"path":"scripts/verify-pdf.py","sizeBytes":14846,"isText":true},{"path":"SKILL.md","sizeBytes":13179,"isText":true},{"path":"tests/fixtures/.gitattributes","sizeBytes":13,"isText":false},{"path":"tests/fixtures/sample.pdf","sizeBytes":2021,"isText":false},{"path":"tests/fixtures/validation-failing.json","sizeBytes":2584,"isText":true},{"path":"tests/smoke_autotag.py","sizeBytes":6178,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"notes-only","suspicious":0,"notes":1,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-29T00:45:10.535443Z","sha256":"9513436F71F3FF9CA5AF7AC395604BC58912EEA93915BBF960F1175515524005","sizeBytes":36609},"review":null,"source":{"repositoryUrl":"https://github.com/PSPDFKit-labs/nutrient-skills","path":"plugins/remediate-pdf/skills/remediate-pdf","license":null,"commit":"83aea52a003a4ebb69fcf78ea724b48cbe950835","subtreeSha":"16F7A96421F256FBB46A8A1E57A369C9CB7944523FE3D4D84334EEC7DEA8982E","lastSyncedAt":"2026-11-29T00:42:56.729498Z"},"reviewedAt":"2026-11-29T00:50:36.402063Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/PSPDFKit-labs/nutrient-skills/tree/main/plugins/remediate-pdf/skills/remediate-pdf"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install pspdfkit-labs-nutrient-skills@llmmart"},{"target":"git","command":"git clone https://github.com/PSPDFKit-labs/nutrient-skills.git"}]}