# Fillable PDF Compare API: Text and AcroForm Fields (`merciful_goldenlarch/pdf-text-form-comparison`) Actor

Compare two PDFs for text and AcroForm field changes: names, types, required flags, choices and page references. Check required mappings before replacing a fillable form. No OCR or visual redline.

- **URL**: https://apify.com/merciful_goldenlarch/pdf-text-form-comparison.md
- **Developed by:** [Toolshed](https://apify.com/merciful_goldenlarch) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 pdf comparisons

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

## Fillable PDF Compare API: Text and AcroForm Fields

Compare two versions of a PDF and see the actual changed text and form-field definitions, with original/revised page references and a review step for each finding. The Actor reads files; it never rewrites your PDF or updates a workflow.

For example, the official W-9 revisions add a line 3b question on page 1. The report includes that new passage so a form owner can review whether their intake questions need changing. It does not interpret tax obligations or decide which answer someone should give.

### Try the included sample

Run with the default IRS 1040-ES 2025/2026 pair, or choose the unchanged-file control. No file preparation is needed for those samples.

### Your own documents

1. Upload your two authorized PDF files as BEFORE.pdf and AFTER.pdf to a private Apify key-value store.
2. Choose My two PDFs in a private Apify store and select that store. Only read access is requested.
3. Run, then open Read the change report in the output links. JSON and Markdown are available too.

Each PDF must be unencrypted, at most 12 MiB and 100 pages. There is no public-URL requirement and no external AI document processor.

Optionally enter the exact field names your automation fills in Field names your workflow uses. A required name absent from the revised file gets a stop-and-remap action. If a name is absent from both files, check your configuration rather than assuming it was removed.

### Read the result

- MISSING_REQUIRED_FIELDS: verify replacement mappings and run a fill-and-readback test before switching.
- MANUAL_REVIEW_REQUIRED: the report lists an extraction, page-alignment, XFA or output-limit issue. Resolve it before relying on the comparison.
- REVIEW_CHANGES: review the quoted passages and named field definitions, then test the affected instructions, mappings or page references.
- NO_SUPPORTED_CHANGES: no differences found by the supported checks; this does not prove your downstream workflow still works.

The JSON contains fieldChanges, textChanges, requiredFieldChecks, reviewWarnings and recommendedAction. Field definitions include inherited types and flags, allowed choices with separate submitted values and labels, and maximum text lengths when specified. Form groups remain distinct from fillable targets, and the Markdown report names each affected field. Each finding has its source pages when available, exact before/after content or definitions, and an action. Matching edited pages uses content similarity and is marked for review. Unpaired pages are not claimed to be verified replacements. Repeated pages can remain ambiguous.

The previous summary keys remain present, including page/field/word counts and document hashes. result can now also be REVIEW_REQUIRED for an unchanged but unreadable or unsupported pair. downstreamCompatibility is always NOT_TESTED.

### Limits and privacy

This compares extracted text and AcroForm definitions. It does not perform OCR, visual/layout comparison, validate entered values or signatures, provide legal/tax interpretation, or test your workflow. Scans, XFA and ambiguous page matches require separate review. Field values are not read into structured definitions; visible PDF text can still contain private values, so keep the run and reports private.

Reports are bounded: 400 text/page findings, 600 field findings, 1,800 characters per text excerpt and 6,000 tokens per page diff. Truncation is explicit and requires review; large or pathological files may fail safely. HTML escapes document content and loads no scripts or external assets. Repeated dataset delivery does not append duplicates.

Maintained by Toolshed. Support: toolshedsupport@gmail.com.

Text differences follow extracted PDF reading order, so a before/after pair is not a verified semantic replacement. Reordered text can appear as additions and removals; inspect the cited pages to confirm context.

### W-9 examples

Choose `w9_2018_vs_2024` to compare the bundled official IRS editions, or `w9_same_file_control` to check the 2024 file against itself. These examples need no uploads. XFA or other unsupported features still require manual review, even for an unchanged file.

### Read the findings

The default result view shows a readable finding, the affected item, what the evidence means and what to do next. Switch to **Evidence and source fields** for the underlying records. Download **REVIEW.csv** to work in a spreadsheet, or **REVIEW.html** for a plain report. Suggested actions are checks for you to perform; the Actor has not executed them. Existing API evidence fields are retained alongside the reading layer.

If the run budget cannot deliver every result row, the run fails rather than silently returning a complete-looking partial dataset. Check **Dataset delivery status** in Output, reduce the input or increase the run budget, and start a new run. A successful dataset-delivery check confirms storage, not source accuracy or full workflow compatibility.

Named comparison reports are published after complete Dataset delivery is verified. An insufficient-budget or incomplete-delivery run does not publish a new complete-looking report; start a new run or resolve the delivery issue before using results.

# Actor input Schema

## `samplePair` (type: `string`):

Use an official IRS sample or choose two PDF records in your private Apify store.

## `sourceStore` (type: `string`):

For your own pair, select the private key-value store where you uploaded the two PDFs. Read access only.

## `beforeKey` (type: `string`):

Use the default BEFORE.pdf or enter the exact uploaded record key.

## `afterKey` (type: `string`):

Use the default AFTER.pdf or enter the exact uploaded record key.

## `requiredFieldNames` (type: `array`):

Paste up to 200 unique exact form-field names your automation fills. Missing names receive an explicit stop-and-remap action; presence alone is not a workflow test.

## Actor input object example

```json
{
  "samplePair": "irs_2025_vs_2026",
  "beforeKey": "BEFORE.pdf",
  "afterKey": "AFTER.pdf",
  "requiredFieldNames": []
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `report` (type: `string`):

No description

## `html` (type: `string`):

No description

## `markdown` (type: `string`):

No description

## `reviewCsv` (type: `string`):

No description

## `reviewHtml` (type: `string`):

No description

## `deliveryStatus` (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 = {
    "samplePair": "irs_2025_vs_2026"
};

// Run the Actor and wait for it to finish
const run = await client.actor("merciful_goldenlarch/pdf-text-form-comparison").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 = { "samplePair": "irs_2025_vs_2026" }

# Run the Actor and wait for it to finish
run = client.actor("merciful_goldenlarch/pdf-text-form-comparison").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 '{
  "samplePair": "irs_2025_vs_2026"
}' |
apify call merciful_goldenlarch/pdf-text-form-comparison --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,merciful_goldenlarch/pdf-text-form-comparison"
        }
    }
}
```

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/koHaO9g0bPo9j1HrG/builds/1PlLxdT5cpVgcH292/openapi.json
