# PDF Accessibility Checker & Fixer: PDF/UA, WCAG, Redaction (`shatrix/pdf-compliance-checker`) Actor

Check PDFs against 32 accessibility rules with an HTML report, find redactions that leave the text underneath extractable, and list hidden data such as metadata, attachments, comments and scripts. Optionally fix title, language, tab order and tags, and remove hidden data.

- **URL**: https://apify.com/shatrix/pdf-compliance-checker.md
- **Developed by:** [Sherif Elsayed](https://apify.com/shatrix) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 pdf checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PDF Accessibility Checker & Fixer: PDF/UA, WCAG, Redaction

Three checks every PDF should pass before it is published or sent out, in one run:

1. **Accessibility**: 32 rules in 7 categories (document, page content, forms, alternate text,
   tables, lists, headings). Each rule passes, fails (with the page and the problem) or needs a
   person's review. A readable HTML report is saved per PDF. Useful for the European
   Accessibility Act, WCAG and PDF/UA work.
2. **Fake redactions**: black boxes painted over text that can still be selected and copied, and
   redaction marks that were never applied. The row shows the exposed text so you can act on it.
3. **Hidden data**: metadata, attachments, comments, form fields, hidden text and layers,
   bookmarks, links, scripts and private application data, counted per category.

Optional fixes save a corrected copy (the original is never changed): title shown in the
viewer's title bar, document language, tab order, automatic tagging of untagged text-only PDFs,
and removal of hidden data.

### Input

```json
{
  "pdfs": ["https://example.com/annual-report.pdf", "https://example.com/court-filing.pdf"],
  "checkAccessibility": true,
  "checkRedactions": true,
  "checkHiddenData": true,
  "fixAccessibility": false,
  "removeHiddenData": false
}
```

Up to 100 PDFs per run, or upload one in `pdf`. Leave both empty to try a built-in sample PDF
for free (its row has `"status": "sample"`). For encrypted PDFs, give `password` (stored
encrypted). `title` and `language` are used by the accessibility fix.

### Output

One dataset row per PDF:

```json
{
  "fileName": "court-filing.pdf",
  "status": "checked",
  "pages": 12,
  "tagged": true,
  "accessibility": {
    "passed": 24, "failed": 2, "manual": 5, "skipped": 1,
    "failedRules": [{"rule": "title", "name": "Title", "category": "document",
                     "findings": [{"message": "The document has no title", "page": null}]}],
    "manualReview": ["Logical Reading Order", "..."]
  },
  "redactions": {"count": 1, "findings": [{"page": 3, "kind": "unapplied-mark", "coveredText": "John Smith"}]},
  "hiddenData": {"total": 10, "categories": {"metadata": 5, "bookmarks": 4, "links-actions-scripts": 1}},
  "reportUrl": "https://api.apify.com/v2/key-value-stores/.../records/002-court-filing-accessibility.html",
  "detailsUrl": "https://api.apify.com/v2/key-value-stores/.../records/002-court-filing-details.json",
  "fixedPdfUrl": null,
  "error": null
}
```

With fixes on, `fixes` lists what was applied, any warnings, and the accessibility result of
the fixed copy, and `fixedPdfUrl` links to it.

### Use with AI agents (MCP)

`https://mcp.apify.com?tools=shatrix/pdf-compliance-checker`

### Use from code

```bash
curl -X POST "https://api.apify.com/v2/acts/shatrix~pdf-compliance-checker/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"pdfs": ["https://example.com/report.pdf"]}'
```

### Pricing

Pay per event: one charge per checked PDF, and one per fixed copy (see the Pricing tab). Files
that can't be opened (not a PDF, wrong password) are not charged.

### Important

- Automatic checks find many, not all, accessibility problems; rules marked for manual review
  need a person. A passing result is not a certification of PDF/UA or WCAG conformance, and this
  is not a PDF/UA validator: on veraPDF's PDF/UA test files it flagged untagged content, but not
  a missing PDF/UA identifier or fonts that aren't embedded.
- Automatic tagging tags text as paragraphs; review headings and reading order afterwards. It
  works on text-only PDFs and is skipped (with a warning) for others.
- A PDF whose security settings forbid changes is still checked; fixing it needs its permissions
  (owner) password in `password`, otherwise the row explains why there is no fixed copy and only
  the check is charged.
- Tested with real PDFs: an IRS tax form with 199 fields, a 142-page IRS publication, scanned
  pages, and AES-128 and AES-256 encrypted files. The redaction audit flagged nothing on these
  real files.
- Files are processed inside the Actor run and are not sent to any other service.

### Credits

Built on PdfCraft from the ArtCraft project (MIT OR Apache-2.0). Text recognition models:
ocrs-models by Robert Knight, trained on HierText, CC-BY-SA-4.0. License texts ship in the
Actor's image under `/opt/engines/licenses/`. This Actor is not affiliated with or endorsed by
the ArtCraft project.

# Actor input Schema

## `pdfs` (type: `array`):

Links to the PDFs to check (up to 100). Leave this and the upload empty to try a built-in sample PDF for free.

## `pdf` (type: `string`):

Or upload one PDF (or give its URL) here.

## `checkAccessibility` (type: `boolean`):

32 rules in 7 categories (document, page content, forms, alternate text, tables, lists, headings). Each rule passes, fails (with findings and pages) or needs a manual review.

## `htmlReport` (type: `boolean`):

Also save a readable HTML report per PDF.

## `checkRedactions` (type: `boolean`):

Find black boxes painted over text that can still be copied, and redaction marks that were never applied.

## `checkHiddenData` (type: `boolean`):

Count metadata, attachments, comments, form fields, hidden text and layers, bookmarks, links and scripts, and private application data.

## `fixAccessibility` (type: `boolean`):

Set the title (shown in the viewer's title bar) and the language, put tab order in structure order, and tag untagged text-only PDFs. Saves a fixed copy; the original is not changed.

## `removeHiddenData` (type: `boolean`):

Remove every hidden-data category (form fields are flattened so their values stay visible). Saves a cleaned copy.

## `title` (type: `string`):

Title to set when fixing accessibility. Empty keeps the PDF's title, or uses the file name.

## `language` (type: `string`):

Primary language to set when fixing accessibility, e.g. en-US or de-DE. Empty leaves it unchanged.

## `password` (type: `string`):

Password for encrypted PDFs (the same for all files).

## Actor input object example

```json
{
  "pdfs": [],
  "checkAccessibility": true,
  "htmlReport": true,
  "checkRedactions": true,
  "checkHiddenData": true,
  "fixAccessibility": false,
  "removeHiddenData": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `files` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pdfs": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("shatrix/pdf-compliance-checker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "pdfs": [] }

# Run the Actor and wait for it to finish
run = client.actor("shatrix/pdf-compliance-checker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pdfs": []
}' |
apify call shatrix/pdf-compliance-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,shatrix/pdf-compliance-checker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fYfLMsicHMTxZUIL2/builds/dwQtcwAFdT1ZLuXsi/openapi.json
