[dba-Tech] Split multi-page PDF file into single pages

Gustav Brock Gustav at cactus.dk
Fri Sep 11 09:32:25 CDT 2009


Hi all

Any methods to do that silently?

I've come this far with Ghostscript:

gswin32c -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=page%d.pdf multipage.pdf

which should split multipage.pdf into page1.pdf, page2.pdf, etc. but no cigar because:

"the one page per file feature is not supported by all devices; in particular it does not work with document-oriented output devices like pdfwrite .."

and then the doc refers to the "-dFirstPage and -dLastPage switches .. for a way to extract single pdf pages."
But that would mean I should somehow find out the count of pages, say 38, and then call Ghostscript 38 times - not very smart.

There must be some other method.

/gustav





More information about the dba-Tech mailing list