I try to split the pages of one PDF file into a separated one-page PDF files. This command does the job so far:

gs \
-q \
-dAutoRotatePages=/None \
-sDEVICE=pdfwrite \
-sOutputFile=test0%d.pdf \

This works, but every time there is one more PDF file generated which is just blank.

Is there a way to avoid this?

used Ghostscript version: 9.05

2 Answers 2


Consider using the poppler-utils tool pdfseparate instead:

pdfseparate pdf-sample.pdf sample-%d.pdf

I've encountered the same behavior. After digging into the documentation it appears that this is a known issue:

Note, however that the one page per file feature may not supported by all devices. Also, since some devices write output files when opened, there may be an extra blank page written (pdfwrite, ps2write, eps2write, pxlmono, pxlcolor, ...).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .