Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How to invoke pdftotext and extract first line of text from PDF file?

by LanX (Saint)
on Mar 28, 2010 at 23:23 UTC ( [id://831521]=note: print w/replies, xml ) Need Help??


in reply to How to invoke pdftotext and extract first line of text from PDF file?

That's what I did:
open ( my $fh, "-|","pdftotext -layout $file -") or die "error extracting $file";

But I really recommend using pdftohtml -xml -stdout instead if you need more reliability about text position, page-number and font (-family, -size and -color) used.

Cheers Rolf

Replies are listed 'Best First'.
Re^2: How to invoke pdftotext and extract first line of text from PDF file?
by brycen (Monk) on Mar 29, 2010 at 05:21 UTC
    You can use backticks also:
    $text = `$Globals::pdftotext_bin -layout $pdffile -`; if ($?) { log_error(...) }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://831521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (8)
As of 2024-04-16 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found