in reply to Re: Converting Text from PDF using CAM::PDF
in thread Converting Text from PDF using CAM::PDF
please run this code and tell me if it works?
It is same code as yours. Since I can't upload my pdf file, I have searched and found another pdf file it fails on. I don't know if it has to do with tables.
If you run u'r code on this, it will not work.
#!/usr/bin/perl use Data::Dumper; use LWP::UserAgent; my $pdf_filename="/tmp/file.pdf"; my $pdf_link = "http://investor.google.com/pdf/2010Q1_earnings_google. +pdf"; $client = LWP::UserAgent->new(); my $capture = $client->get("$pdf_link", ":content_file" => "$pdf_filen +ame"); convert_pdf_to_text(); sub convert_pdf_to_text { use CAM::PDF; use CAM::PDF::PageText; my $pdf = CAM::PDF->new($pdf_filename) || die "$CAM::PDF::errstr\n +"; foreach (1..($pdf->numPages())) { my $x=CAM::PDF::PageText->render($pdf->getPageContentTree($_)) +; print "$x\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Converting Text from PDF using CAM::PDF
by ww (Archbishop) on Jun 22, 2010 at 22:35 UTC | |
|
Re^3: Converting Text from PDF using CAM::PDF
by Khen1950fx (Canon) on Jun 22, 2010 at 23:23 UTC | |
by ww (Archbishop) on Jun 23, 2010 at 00:12 UTC | |
by Anonymous Monk on Jun 22, 2010 at 23:36 UTC |