Skip to main content
Participating Frequently
February 17, 2025
Question

Remove blank pages with only page number.

  • February 17, 2025
  • 1 reply
  • 148 views

Hello everyone,
Is there a quick way/function to remove all blank pages that only have page numbers/a maximum number of characters?

This is possible manually and can also be done with documents that do not consist of too many pages. If it is a scanned document, I sometimes come across documents where only the odd pages are blank. Then it is just a matter of plotting only the even pages with Adobe.

The problem is that I also have documents of >500 pages, which contain a lot of blank pages and these are also spread criss-cross through the document.
Doing it manually will take me a while.

Anyone have an idea?
Thanks

1 reply

try67
Community Expert
Community Expert
February 17, 2025

It's not possible if the pages are scanned, but if they have "real" text then a script can be used to identify the number of words (or characters, although that is more complicated) on the page and remove it if it's below a certain threshold, yes.

For example, this code will remove all pages with 0 or 1 words:

 

var cnt = 0;
for (var p=this.numPages-1; p>=0; p--) {
	var numWords = this.getPageNumWords(p);
	if (numWords<2) {
		this.deletePages(p, p);
		cnt++;
	}
}
app.alert("Done. " + cnt + " pages were deleted.",3);