Splitting a PDF with Ghostscript
ghostscript, pdf-generation
Solution
What you see is "normal" behaviour: the current version of Ghostscript's `pdfwrite` output device does not support this feature. This is also (admittedly, somehow vaguely) documented in Use.htm:
"Note, however that the one page per file feature may not be supported by all devices...."
I seem to remember that one of the Ghostscript developers mentioned on IRC that they may add this feature to pdfwrite in some future release, but it seems to necessitate some major code rewrite, which is why they haven't done it yet...
Update: As Gordon's comment already hinted at, as of version 9.06 (released on July 31st, 2012), Ghostscript now supports the commandline as quoted in the question also for `pdfwrite`. (Gordon must have discovered the unofficial support for this already in 9.05, or he compiled his own executable from the pre-release sources which were not yet tagged as 9.06).
Problem
I try to split a multipage PDF with Ghostscript, and I found the same solution on more sites and even on ghostscript.com, namely: ``` gs -sDEVICE=pdfwrite -dSAFER -o outname.%d.pdf input.pdf ``` But it seems not working for me, because it produces one file, with all pages, and with the name outname.1.pdf. When I add the start and end pages, then it is working fine, but I want it to work without knowing those parameters. In the gs-devel archive, I found a solution for this: http://ghostscript.com/pipermail/gs-devel/2009-April/008310.html -- but I feel like doing it without `pdf_info`. When I use a different device, for example `pswrite`, but same parameters, it works correctly, producing as many ps files, as my input.pdf contains. Is this normal when using `pdfwrite`? Am I doing something wrong?