[gs-bugs] [Bug 692250] Add -sPages option

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Thu Jun 2 16:19:40 UTC 2011


http://bugs.ghostscript.com/show_bug.cgi?id=692250

--- Comment #7 from Ray Johnston <ray.johnston at artifex.com> 2011-06-02 16:19:39 UTC ---
The PostScript sequence to process pages from a PDF in arbitrary order relies 
on two simple Ghostscript specific operators:

   (filename.pdf) (r) file runpdfbegin % this loads the tables for the PDF

After the above, the number of pages will be in 'pdfpagecount'

   <first> <last> dopdfpages % processes page ranges in arbitrary

Examples:

   1 pdfpagecount dopdfpages % the default order

   pdfpagecount -1 1 { dup dopdfpages } for % process pages reverse order

   1 2 pdfpagecount { dup dopdfpages } for % process odd pages
   2 2 pdfpagecount { dup dopdfpages } for % process even pages

   [ 1 5 9 2 6 10 3 7 4 8 ] { dup dopdfpages } forall % arbitrary order

I guess that we can just tell folks to use 'pdfwrite' on whatever the input
file is (PS, PDF, PCL, XPS), then run again with the above "trick" to
whatever output format (-sDEVICE) is desired.

-- 
Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the gs-bugs mailing list