sushaant29 has asked for the wisdom of the Perl Monks concerning the following question:

I want to search for strings patterns in a pdf file, I have been using PDF::API2 module for it, but I tried to write down following piece of code, got some wierd result (a huge list of special characters). My code is:

use PDF::API2; use PDF; print "hello world\n"; $pdf = PDF::API2->open('DEN.pdf'); print $pdf->stringify; print "ok";

I am not sure, if PDF:: API2 will be of use, and it will be very helpful if you can suggest me something in regard to my problem

Code tags and formatting added by GrandFather

Replies are listed 'Best First'.
Re: Searching for the content in a PDF file
by runrig (Abbot) on Jun 08, 2006 at 23:36 UTC
    You can try texttopdf. I have had better results with it than PDF::API2::stringify().

    Update: I haven't tried it, but CAM::PDF::getpdftext.pl might be worth looking at also.