in reply to Re: I have a problem in finding corrupted PDF files
in thread I have a problem in finding corrupted PDF files

Thanks for your Reply. But still i'm getting the following errors.

1) Bad object reference in the line'. ("$path/$aa"). 2)If the pdf file is corrupted one, it shows the error "Can't read cross-reference section, according to trailer" and terminate the program.

I want to get a corrupted pdf file list.

  • Comment on Re^2: I have a problem in finding corrupted PDF files

Replies are listed 'Best First'.
Re^3: I have a problem in finding corrupted PDF files
by almut (Canon) on Dec 11, 2007 at 11:29 UTC
    If the pdf file is corrupted one, it shows the error "Can't read cross-reference section, according to trailer" and terminate the program.

    This is exactly one of the cases I had in mind when I said "PDF->new() does die in some cases". As this is a simple, straightforward die message in PDF/Parse.pm (line 82),

    sub ReadCrossReference_pass1 { ... $_=PDF::Core::PDFGetline ($fd,\$offset); die "Can't read cross-reference section, according to trailer\n" if +! /xref\r?\n?/ ; ... }

    I'm pretty sure (actually, I've tried it) that it will be caught, if you wrap the call in an eval block with curly braces, as shown in my previous reply. That's exactly what that eval BLOCK form (Perl's exception handling mechanism) is for.

    If you still can't keep the script running in that case, please post the exact code you're using.

Re^3: I have a problem in finding corrupted PDF files
by fxy (Initiate) on Jan 27, 2008 at 15:33 UTC
    Hi: You can try a popular PDF file recovery tool called Advanced PDF Repair to repair your PDF file. It is a powerful tool to repair corrupt or damaged PDF files. Detailed information about Advanced PDF Repair can be found at http://www.datanumen.com/apdfr/ And you can also download a free demo version at http://www.datanumen.com/apdfr/apdfr.exe Alan