I am using CAM::PDF, with getpagecontenttree and pagetext->render to read PDF files.
The program often hangs for an extended period of time and then takes off again. I tried processing an offending file all by itself to see if there's any accumulated garbage collection and that's not it.
Any ideas or better techniques?
my $doc = CAM::PDF->new($filename) || die "$CAM::PDF::errstr\n";
foreach my $p ( $doc->rangeToArray( 1, $doc->numPages(), $pagelist
+ ) ) {
print "working on page $p of $filename\n";
my $tree = $doc->getPageContentTree( $p, $opts{verbose} );
my $this_page_text = CAM::PDF::PageText->render($tree);
$whole_text .= $this_page_text;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.