Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by LanX (Canon)
on Mar 28, 2010 at 23:23 UTC ( #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


Comment on Re: How to invoke pdftotext and extract first line of text from PDF file?
Select or Download Code
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
Node Status?
node history
Node Type: note [id://831521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-08-28 04:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (256 votes), past polls