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

Gustav Brock Gustav at cactus.dk
Fri Sep 11 16:09:03 CDT 2009


Hi Jim

The pdftk _is_ a command line tool. 

/gustav

>>> accessd at shaw.ca 11-09-2009 18:12 >>>
Thanks for the tip Gustav. I do not need it now but it is good to know such
a trick. This burst method will also run at the command prompt I assume.

Jim

-----Original Message-----
From: dba-tech-bounces at databaseadvisors.com 
[mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Friday, September 11, 2009 8:11 AM
To: dba-tech at databaseadvisors.com 
Subject: Re: [dba-Tech] Split multi-page PDF file into single pages

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