[prev in list] [next in list] [prev in thread] [next in thread]
List: cups
Subject: [cups.general] Alternative way to find no. of pages inside PDF?
From: Kurt Pfeifle <kurt.pfeifle () infotec ! com>
Date: 2008-06-14 14:21:08
Message-ID: 32932-cups.general () news ! easysw ! com
[Download RAW message or body]
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?
Using Ghostscript to render the PDF and then count pages is way too slow... I know \
Ghostscript somehow has access to the info, because I can run
gs \
-dBATCH \
-dNOPAUSE \
-sDEVICE=nullpage \
-dFirstPage=9999 \
-dLastPage=9999 \
a-211-page.pdf
does give me this output :
[....]
Requested FirstPage is greater than the number of pages in the file: 211
No pages will be processed (FirstPage > LastPage).
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?
Cheers,
Kurt
_______________________________________________
cups mailing list
cups@easysw.com
http://lists.easysw.com/mailman/listinfo/cups
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic