Free plan

Compare PDFs

Compare two PDFs and see what changed between them
POST
/v1/pdfs/compare

About this tool

This tool compares two versions of a PDF and shows the differences. It can compare the text line by line, show a picture of what changed on each page, or give one line per page that says whether it is the same or changed. You can limit the check to some pages or to an area of the page.
For example, you see what was edited between the first and the final version of a contract.

How to use it

  1. Choose this tool.
  2. Add the first PDF in the first slot and the second PDF in the second slot.
  3. Choose how to compare: text, picture or page by page.
  4. Optionally choose which pages to compare.
  5. Press Generate and read the differences.

What you get back

You get a report of what is different, and for the picture mode a picture of the changes on each page.
GOOD TO KNOW
Visual comparison supports at most 200 pages per document.
TEST IT LIVE

Try Compare PDFs in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/compare
Tool ID
pdfs.compare
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/compare" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'fileA=@document.pdf' \
  -F 'fileB=@document.pdf' \
  -F 'mode=text' \
  -F 'dpi=100' \
  -F 'threshold=0.1'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.compare({
    "fileA": 'document.pdf',
    "fileB": 'document.pdf',
    "mode": "text",
    "dpi": 100,
    "threshold": 0.1
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->compare([
    'fileA' => 'document.pdf',
    'fileB' => 'document.pdf',
    'mode' => 'text',
    'dpi' => 100,
    'threshold' => 0.1,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Compare two PDFs and see what changed between them.

Compare PDFs accepts PDF. Send one file per request.

Compare PDFs is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/compare with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.