Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to read a pdf file using active perl?

Reply
Thread Tools

How to read a pdf file using active perl?

 
 
johny
Guest
Posts: n/a
 
      08-28-2006
Hi,
I am trying to read a PDF file using active Perl. I tried with
PDF::API2 but no use. For example - I should get the text which is on
the third line of first page...

or

Is there any way where I can save the pdf file as a .txt file and then
read the file?
Please help........

Thanks,
AJ

 
Reply With Quote
 
 
 
 
David Squire
Guest
Posts: n/a
 
      08-28-2006
johny wrote:
> Hi,
> I am trying to read a PDF file using active Perl. I tried with
> PDF::API2 but no use. For example - I should get the text which is on
> the third line of first page...
>
> or
>
> Is there any way where I can save the pdf file as a .txt file and then
> read the file?
> Please help........


Do you need to use Perl? There is the command-line utility pdftotext
that is available on most UNIX-like systems (and no doubt cygwin).

You need to be aware that there is no guarantee that you can get text
out of a PDF document. The PDF standard allows arbitrary encodings to be
used, so you would have to know what the glyph names mean to reconstruct
the text. In some cases the glyph names are not meaningful. See
http://www.glyphandcog.com/textext.html

That being said, pdftotext works in the great majority of cases.


DS
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
File.read(fname) vs. File.read(fname,File.size(fname)) Alex Dowad Ruby 4 05-01-2010 08:20 AM
Postscript to PDF with pdf-tools, pdf-writer, or other Sean Nakasone Ruby 1 04-14-2008 09:13 PM
PDF::Writer, create pdf and insert in other pdf file. Ricardo Pog Ruby 1 03-26-2008 08:24 PM
How can I read pdf file and save content in text file ? Alex Smith ASP .Net 0 06-15-2005 06:05 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57