Free plan

Remove blank pages

Find and delete the empty pages of a PDF
POST
/v1/pdfs/remove-blank

About this tool

This tool finds blank pages, for example the empty backs of sheets scanned on both sides, and removes them. It decides a page is blank when it has almost no ink inside the margins. You can change how strict it is, keep the first page, protect pages that have hidden text, or only get a report without removing anything.
For example, you scanned a stack of single-sided papers on a double-sided scanner and now every second page is empty.

How to use it

  1. Choose this tool.
  2. Add your PDF.
  3. If you only want to see which pages are blank, turn on the report-only option.
  4. If needed, adjust how much ink still counts as blank, or which pages to check.
  5. Press Generate, then download the cleaned PDF or read the list.

What you get back

You get a new PDF without the blank pages, or a list of the blank pages if you chose report only. Check the result, since a very light page could be removed by mistake.
GOOD TO KNOW
Every page being blank is refused (400). A page with a faint stamp or a few words may be below the threshold: lower it. Counts as one PDF operation.
TEST IT LIVE

Try Remove blank 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/remove-blank
Tool ID
pdfs.remove-blank
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/remove-blank" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'pages=1-3' \
  -F 'threshold=0.3' \
  -F 'margin=5'

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.removeBlank({
    "file": 'document.pdf',
    "pages": "1-3",
    "threshold": 0.3,
    "margin": 5
  });
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()->removeBlank([
    'file' => 'document.pdf',
    'pages' => '1-3',
    'threshold' => 0.3,
    'margin' => 5,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Find the blank pages of a PDF (typical of double-sided scans) by how much ink they carry inside the margins, and take them out; or only report them.

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

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

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