2

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 \
-dQUIET \
-dSAFER \
-dBATCH \
-dNOPAUSE \
-dNOPROMPT \
-dAutoRotatePages=/None \
-sDEVICE=pdfwrite \
-sOutputFile=test0%d.pdf \
-fpdf-sample.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

3

Consider using the poppler-utils tool pdfseparate instead:

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

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, ...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.