Remove blank pages and covers from PDFs by API

Delete blank pages, fax covers and appendices from a PDF with one API call. The page list, the rule that keeps at least one page, and how to find blank pages first.

A blank second page is crossed out and the document comes back without it

Duplex scanners leave blank backs. Fax gateways add cover sheets. Report generators append pages nobody reads. The PDF Remove Pages API deletes the pages you list and keeps the rest exactly as they are.

curl https://api.justapi.tech/v1/pdf/remove-pages \
  -H "Authorization: Bearer ak_live_..." \
  -H "Content-Type: application/json" \
  -d '{"source": {"url": "https://files.example.com/fax-2026-11-05.pdf"}, "options": {"pages": "1,even"}}'

That call drops the fax cover (page 1) and every even page, the blank backs of a duplex scan.

Page lists

pages uses the same syntax as every page tool: 2, 5-6, 10-, -1 for the last page, odd, even, or a JSON list. Combine them with commas.

At least one page stays

A PDF needs at least one page. If your list covers every page, the call fails with invalid_request and is not charged. Your code does not need to check the page count first.

Finding blank pages

The API removes the pages you name; it does not decide which pages are blank. Blank detection is a judgement call: a page with a faint scanner shadow, or one with only "This page intentionally left blank", is blank to a person but not to a pixel count. Two ways to do it:

  • Fixed pattern. If your scanner always duplexes and your documents are one-sided, drop even.
  • Check thumbnails. Render pages at 36 DPI with the PDF to Image API, measure how much of each image is near-white in your own code, and send the numbers above your threshold.

Nothing else changes

The pages you keep are copied with their content as is, in their original order. The response tells you stats.pages kept and stats.pages_removed.

Cost

$0.005 per call at the first tier. Signed and encrypted PDFs are refused with signed_pdf and encrypted_pdf, at no charge.

The free page remover handles a one-off file in the browser.