PDF Compare – Text & Visual Diff of Two PDFs
Pricing
from $10.00 / 1,000 document pair compareds
PDF Compare – Text & Visual Diff of Two PDFs
Compare two versions of a PDF: word-level text diff per page (added, removed, changed) plus a visual pixel diff with highlighted diff images and changed regions. Handles inserted/deleted pages. No external APIs.
Pricing
from $10.00 / 1,000 document pair compareds
Rating
0.0
(0)
Developer
Camp8 fr0
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
a day ago
Last modified
Categories
Features
Share
PDF Compare – Find Differences Between Two PDFs (Text Diff + Visual Diff)
PDF Compare shows exactly what changed between two versions of a PDF. It runs a word-level text diff on every page (added, removed and changed words with context and positions) and a visual pixel diff that catches changes text tools miss: images, logos, signatures, stamps, colours, layout shifts and scanned pages. For every changed page you get a highlighted diff image and the changed regions as coordinates. Inserted and deleted pages are detected automatically. Everything runs inside the Actor: no external APIs, and your documents never leave Apify.
What does PDF Compare do?
- 📝 Word-level text diff per page:
changed(old → new),addedandremovedpassages with surrounding context and bounding boxes on both versions. - 🖼️ Visual diff: both versions are rendered and compared pixel by pixel with anti-aliasing detection (pixelmatch), so font smoothing noise is ignored.
- 🎯 Highlighted diff images: faded original page, removed ink in red, added ink in green, changed regions boxed in orange.
- 📐 Changed regions as rectangles in PDF points (top-left origin) for building your own overlays or review UIs.
- 📑 Smart page alignment: an inserted or deleted page doesn't make every following page "different". Pages are matched by content; replaced pages are compared with each other.
- 🧾 Summary:
identical, changed / added / removed pages, total words added and removed. - 🔐 Encrypted PDFs (password), batch mode with many pairs, and an HTTP API (Standby mode).
Use cases
- Contract and legal redlining: see every changed clause between two drafts
- Invoice, quote and price list checks: spot changed amounts, dates and line items
- Regulatory and policy documents: track what changed between versions
- Publishing and print QA: compare proofs, catch moved logos or broken layouts
- Automated regression tests for PDF generators (reports, invoices, tickets)
- Monitoring: combine with a scheduler to detect when a published PDF changes
How to use it
- Click Try for free.
- Paste the Original PDF URL and the Revised PDF URL (or a list of pairs).
- Keep text and visual comparison on (default) and click Start.
- Open the Comparisons view: each pair is one row with the summary and a preview of the first changed page. The
pagesarray has the per-page details, the diff images are in the key-value store.
Call it as an HTTP API (Standby mode)
# GET with query parameterscurl "https://<your-standby-url>/?originalPdfUrl=https://example.com/v1.pdf&revisedPdfUrl=https://example.com/v2.pdf" \-H "Authorization: Bearer <APIFY_TOKEN>"# POST with a JSON body (same fields as the Actor input)curl -X POST "https://<your-standby-url>/" \-H "Authorization: Bearer <APIFY_TOKEN>" -H "Content-Type: application/json" \-d '{"originalPdfUrl":"https://example.com/v1.pdf","revisedPdfUrl":"https://example.com/v2.pdf","compareVisual":true,"dpi":150}'
Response: { "count": 1, "items": [ ...comparison... ] }
You can also use the Apify API (run-sync-get-dataset-items), the Apify MCP server, Make, Zapier, n8n and other integrations. AI agents can pay per call with x402 (USDC) through Apify's agentic payments, without needing an Apify account.
Input example
{"originalPdfUrl": "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/coolblue1.pdf","revisedPdfUrl": "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/coolblue2.pdf","compareText": true,"compareVisual": true,"diffImages": true,"dpi": 100}
| Field | Description |
|---|---|
originalPdfUrl / revisedPdfUrl | The two versions to compare |
pairs | Batch: [{"original": url, "revised": url}, ...] |
compareText | Word-level text diff (default on) |
compareVisual | Pixel diff (default on) |
diffImages | Save highlighted PNGs for visually changed pages (default on) |
dpi | Render resolution for the pixel diff (50-300, default 100) |
pixelThreshold | Colour tolerance 0-1 (default 0.1); raise to ignore small colour/compression changes |
caseSensitive | Case-sensitive text diff (default on) |
maxPages | Page limit per document (default 300) |
password | Password for encrypted PDFs (used for both) |
Output example
{"originalUrl": "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/coolblue1.pdf","revisedUrl": "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/coolblue2.pdf","identical": false,"summary": "1 changed page(s): 1; 100 word(s) added, 67 removed","originalPageCount": 1,"revisedPageCount": 1,"pagesCompared": 1,"changedPages": [1],"addedPages": [],"removedPages": [],"wordsAdded": 100,"wordsRemoved": 67,"firstDiffImageUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/coolblue2-08a01b0f8490-diff-p0001","pages": [{"originalPage": 1,"revisedPage": 1,"status": "changed","textChanged": true,"visualChanged": true,"wordsAdded": 100,"wordsRemoved": 67,"diffPercent": 1.108,"changes": [{ "type": "changed", "original": "www.tabletcenter.nl", "revised": "www.laptopshop.nl", "context": "3012 CN Rotterdam Nederland","originalBox": { "left": 445, "top": 102.8, "width": 76.2, "height": 8 }, "revisedBox": { "left": 445, "top": 102.8, "width": 73.1, "height": 8 } },{ "type": "changed", "original": "19 april", "revised": "29 maart", "context": "993548900 Factuurnummer: 6669263 Klantnummer:" }],"changedRegions": [{ "left": 463.7, "top": 100.8, "width": 60.5, "height": 15.1 }],"diffImageUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/coolblue2-08a01b0f8490-diff-p0001"}]}
Page status values: unchanged, changed, added (only in the revised PDF), removed (only in the original), not-compared (max cost reached).
Pricing
This Actor uses pay-per-event pricing:
| Event | Price |
|---|---|
| Document pair compared (includes the first 20 page pairs) | $10 per 1,000 comparisons ($0.01 each) |
| Extra page pair beyond 20 | $0.50 per 1,000 pages ($0.0005 each) |
A 10-page contract costs $0.01, a 100-page report $0.05. Failed downloads and broken PDFs are free. Apify platform usage (compute) is billed separately. Set Maximum cost per run to cap your spend; if the budget runs out mid-document, the remaining pages are marked not-compared.
FAQ
Does it work with scanned PDFs? Yes, through the visual diff: scanned pages are compared pixel by pixel and changed regions are boxed. The text diff needs a text layer (run OCR first, e.g. with a searchable-PDF Actor, if you also want word-level changes).
Why do I see changes when the text looks identical?
The visual diff also reports layout shifts, re-flowed text, font or colour changes and re-rendered images. If your PDFs come from different generators, raise pixelThreshold (e.g. 0.3) or disable compareVisual and rely on the text diff.
How are pages matched?
By content: pages are aligned with a similarity-based sequence alignment, so an inserted page shows up as added and the following pages still line up. Pages replaced at the same spot are compared with each other.
In which order are words compared?
In geometric reading order (top to bottom, left to right). This keeps diffs stable even when two exports write the same text in a different internal order. In multi-column layouts lines of neighbouring columns are interleaved, which can make the context look unusual but doesn't create false changes.
Which languages are supported? Any language with a text layer (Latin, Cyrillic, Greek, CJK, Arabic...). Words are split on whitespace, so for Chinese/Japanese text without spaces a "word" may be a whole phrase.
How big can the documents be? Up to 150 MB and 2,000 pages each (default limit 300). Memory: 2 GB is enough for typical documents at 100 DPI; use 4 GB for 300 DPI or very large pages.
Is my data private? Files are processed inside your Apify run; diff images are stored only in your run's key-value store. Nothing is sent to third-party services.
Licenses? pdf.js (Apache-2.0), pixelmatch (ISC), jsdiff (BSD-3-Clause), @napi-rs/canvas (MIT). All allow commercial use.