hurix_03 has asked for the wisdom of the Perl Monks concerning the following question:
How can i find the corrupted pdf files in perl
I have used the coding below, can any one correct me, The program loops only once and Exits, How can i get the error report
use CAM::PDF; use PDF; undef $/; my $path =$ARGV[0]; opendir(DIR, $path) || die $!; @all = grep/\.pdf/, readdir(DIR); closedir (DIR); foreach $aa (@all) { my $pdf = PDF->new($aa); if ($pdf->IsaPDF) { print "is a pdf file\n" } else { print "pdf $aa is corrupted\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I have a problem in finding corrupted PDF files
by shmem (Chancellor) on Dec 10, 2007 at 13:07 UTC | |
|
Re: I have a problem in finding corrupted PDF files
by almut (Canon) on Dec 10, 2007 at 15:05 UTC | |
by hurix_03 (Initiate) on Dec 11, 2007 at 05:39 UTC | |
by almut (Canon) on Dec 11, 2007 at 11:29 UTC | |
by fxy (Initiate) on Jan 27, 2008 at 15:33 UTC |