Free plan

Remove duplicate pages

Remove pages that appear twice in a PDF
POST
/v1/pdfs/dedupe-pages

About this tool

This tool finds pages that look the same as another page, for example when a document was scanned twice, and removes the extra copies. You choose whether to keep the first or the last copy, and how alike two pages must be. You can limit it to pages that sit next to each other. A report-only option lists the duplicates without changing the file.
For example, you clean up a scan in which some pages were scanned two times.

How to use it

  1. Choose this tool.
  2. Add your PDF with Upload or drag and drop.
  3. Choose whether to keep the first or the last copy.
  4. Adjust how alike pages must be, or tick report only to just see the duplicates.
  5. Press Generate, then download the PDF.

What you get back

You get a new PDF without the duplicate pages and a note of which pages were removed. With report only you get the list and no change.
GOOD TO KNOW
Pages are compared by how they look, so a rescan of the same sheet with a different skew may fall under the threshold: lower similarity. Counts as one PDF operation.
TEST IT LIVE

Try Remove duplicate pages 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/dedupe-pages
Tool ID
pdfs.dedupe-pages
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/dedupe-pages" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'pages=1-3' \
  -F 'similarity=98' \
  -F 'keep=first'

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.dedupePages({
    "file": 'document.pdf',
    "pages": "1-3",
    "similarity": 98,
    "keep": "first"
  });
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()->dedupePages([
    'file' => 'document.pdf',
    'pages' => '1-3',
    'similarity' => 98,
    'keep' => 'first',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Find the pages of a PDF that look the same as another page (a document scanned twice, a repeated cover) and take the extra copies out, keeping the first or the last; or only report them.

Remove duplicate pages accepts PDF. You can send several files in one request.

Remove duplicate pages is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/dedupe-pages 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.