Here's a quick comparison of PDF-related modules

Wait, I don't see any beyond (incomplete) enumeration, looks like you forgot to append results. Oh, then, here they are (some of them for a start), and using simple test file generated with code you kindly provided:

use strict; use warnings; use PDF::API2; use CAM::PDF; use Benchmark 'cmpthese'; my $fn = 'test.pdf'; my $str = do { local ( @ARGV, $/ ) = $fn; <> }; cmpthese -1, { 'PDF::API2' => sub { PDF::API2-> from_string( $str )-> page_count }, 'CAM::PDF' => sub { CAM::PDF-> new( $str )-> numPages }, 'CAM::PDF+' => sub { my $d = CAM::PDF-> new( $str ); $d-> cacheObjects; $d-> numPages }, }; __END__ Rate PDF::API2 CAM::PDF+ CAM::PDF PDF::API2 163/s -- -74% -95% CAM::PDF+ 614/s 277% -- -83% CAM::PDF 3586/s 2106% 484% --

The 'plussed' entry (kind of "parse everything") is for those who may have (reasonable) doubts if perhaps one module (guess which) makes harder effort to extract a lot more info initially, to provide a user with richer environment to inspect things more cosily (or something like that); but in fact, they (nonplussed) seem both to extract approximately same amount of info on open. It's just one parser (guess which) is very poor indeed.


In reply to Re^2: Help with PDF module [comparison] by Anonymous Monk
in thread Help with PDF module by BernieC

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.