Как насчет использования Perl с PDF :: API2?
#!/usr/bin/perl
use PDF::API2;
foreach $doc (@ARGV)
{
$pdf = PDF::API2->open($doc);
$pages = $pdf->pages;
$totalpages += $pages;
print "$doc contains $pages pages\n";
}
print "Total pages of pdf pages = $totalpages\n";