I am using pdftotext to extract text from multipage pdf's and it works great. I need to look for certain lines counting from the top of each page. I can find out how many pages are in the pdf and I see that pdftotext has first page / last page parameters but was looking for a way to do this more efficiently then say, invoking multiple file handles on the same document (running a page loop with the pdftotext filehandle within the loop).
Below is the code I am using to extract the data of the entire document
open (FILE, "pdftotext -layout multipage.pdf - |");
my($line) = $_;
print "\n<div class=\"line\"><div>$i</div>$line</div>";