Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8977747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:26:35+00:00 2026-06-15T19:26:35+00:00

Is there a reliable way to detect blank pages with a perl script? I

  • 0

Is there a reliable way to detect blank pages with a perl script? I tried to do it with to following script by using the getPageText method. If I do it like that, pages which only contain graphics without text are also recognized as blank pages.

#!/usr/bin/perl -w

use CAM::PDF;
my $filename=$ARGV[0];
my $doc = CAM::PDF->new($filename) || die "$CAM::PDF::errstr\n";
my $pages = $doc->numPages();
print $pages;

$content=$doc->getPageText(1);
print "length".length($content);
if(length($content)==0)
{
  print "File is empty";
}

foreach my $p ( 1 .. $doc->numPages() ) {
    my $str = $doc->getPageText($p);
    $str =~ m/[[:alnum:]]+/ms );  # actually returned text
    print "Result text:".qq($str);
 }

Is there another approach to find blank pages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:26:36+00:00Added an answer on June 15, 2026 at 7:26 pm

    Sorry, there is no way to reliable detect blank pages.

    However, I did this in the past:

    I used pdftk to burst the pdf into one page pdf document.
    If one of the pdfs size is very low, it does not contain images.
    If pdftotext returns empty string it does not contain text.
    Use pdftk to assemble all good pdfs into one.

    I hope it will will helps you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a reliable way to access the client machine's clipboard using Javascript? I
Is there a flag or other reliable method to detect if a compiled C++
Is there a reliable way to detect iPhone 4 (as opposed to iPhone 3
Is there a reliable way in Android to detect the beginning and end of
Is there a reliable way, using PHP, to determine if a request comes from
Is there a reliable way to extract text from PDF? The first thought that
As the title says, is there a reliable way to detect whether a user
Is there a reliable way to specify physical dimensions in CSS such that when
I'm trying to find if there is a reliable way (using SQLite ) to
Is there any reliable way how to check whether ASP.NET 4.0 registered on IIS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.