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

Gustav Brock Gustav at cactus.dk
Fri Sep 11 10:11:20 CDT 2009


Hi all

Found the method here at pdftk, PDF Tool Kit:

  http://www.accesspdf.com/pdftk/

Burst a Single PDF Document into Single Pages and Report its Data to doc_data.txt
  pdftk multipage.pdf burst

will produce a series of page files named pg_0001.pdf etc.
And it runs fast as well.

/gustav


>>> Gustav at cactus.dk 11-09-2009 16:32 >>>
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