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(...) }