pdfblah.com

← All guides

Remove blank and duplicate pages

A PDF that passes through several people picks up junk: blank separator pages from double-sided scanning, whole sections re-inserted by the third forwarder. tidy drops both in one command and tells you exactly what went and why.

Local only, and deliberately not AI. This runs entirely on your own machine, free, as part of the open source pdfblah CLI. Nothing is uploaded, and no model guesses at your content: the decisions are pixel arithmetic and a hash, the same result every time. That is the right tool for sensitive documents.

What counts as blank, what counts as duplicate

The rules are deterministic and conservative, tuned to never eat a page you meant to keep:

How to do it

pip install "pdfblah[app]"

# preview: which pages would go, and why (writes nothing)
pdfblah tidy in.pdf --dry-run

# drop blank pages and exact repeats
pdfblah tidy in.pdf -o tidy.pdf

# only dedupe, keep the blanks (or the reverse: --keep-duplicates)
pdfblah tidy in.pdf -o tidy.pdf --keep-blank

# a whole folder
for f in *.pdf; do pdfblah tidy "$f" -o "tidied/${f%.pdf}-tidy.pdf"; done

The report looks like this:

tidy: kept 34 of 41 page(s), dropped 7 -> tidy.pdf
  page 2: blank
  page 9: duplicate of page 3
  ...

Tips