Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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
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
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 exploiting the Monastery: (10)
As of 2015-07-31 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls