http://www.perlmonks.org?node_id=1026351


in reply to Re: PDF extract
in thread PDF extract

Thanks J, I meant to change that. I'll continue to try and figure out extracting PDF text..

Replies are listed 'Best First'.
Re^3: PDF extract
by PerlSufi (Friar) on Mar 31, 2013 at 20:50 UTC
    Here is what I have so far. When I tried to run it I got the error message Can't call method "getRootDict" on an undefined value..."
    use CAM::PDF; use PDF::API2; my $file_name = shift; my $pdfone = CAM::PDF->new('pdfone.pdf'); for my $page (1 .. $pdfone->numPages()) { my $text = $pdfone->getPageText($page); @lines = split (/\n/, $text); foreach (@lines) { my $pdf = CAM::PDF->new('new.pdf'); $pdfone->appendPDF($pdf); } }