[cups.general] Alternative way to find no. of pages inside PDF?

Kurt Pfeifle k1pfeifle at gmx.net
Sun Jun 15 07:12:05 PDT 2008


Jerome Alet wrote:
> On Sat, Jun 14, 2008 at 07:21:08AM -0700, Kurt Pfeifle wrote:
>> I know I can use pdfinfo from the xpdf package like this
>>
>>    pdfinfo some.pdf|grep Pages:|awk '{print $2}'
>>
>> in order to find out how many pages are in a given PDF, and get 
>> the result very fast. But what if I do not have a "pdfinfo" utility 
>> available (Ghostscript is available...) 
>>
>> Does anybody of you know a different (fast enough) method to know 
>> the number of pages inside a PDF? 
>>
>> ...
>> Which other way than running the above command, grepping for that 
>> line and awk-printing the final number (which is 4-5 times slower 
>> than using pdfinfo) can you think of? 
>>
> 
> What about using pkpgcounter from www.pykota.com ?

Unfortunately this is ruled out... (for the same reason xpdf/pdfinfo
cannot be used: space limitations on an old Solaris box; also, AFAIU,
pkpgcounter would require a nearly full-blown installation of a rather
current Python package).

-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS




More information about the cups mailing list