Split multi-page PDF file into separate pages

Possible duplicate:
Split PDF documents into separate pages using PHP (or possibly perl)

How can I split a multi-page PDF file into separate single-page PDF files in PHP on a Linux server? Are there any PHP libraries or free command line tools for this?

+1
split linux php pdf
05 Oct
source share
3 answers

The latest version of Ghostscript (v9.06) can also do this. Here is the command line that will be used inside the cmd.exe DOS-Box window on a 32-bit Windows system:

  gswin32c.exe ^ -o original_page_%03d.pdf ^ -sDEVICE=pdfwrite ^ -sPDFSETTINGS=/prepress ^ original-multipage.pdf 

-o ... : this indicates the name of the output file (s).
%03d : this part of the file name will be converted to 3-digit digits, supplemented by leading 0 s, starting with 001 for the first page.
-sPDFSETTINGS=... : optional parameter; if used, the inclusion of all used fonts and some other settings will be ensured, which in general provide high quality output.

Ghostscript is available for Windows. (The link above leads you to the installers: gs906w32.exe and gs906w64.exe . Scroll down to find them ...).

+3
Oct 05
source share

You can use pdftk

 exec("pdftk " . $pdflargeFile . " burst output " . $outputPath); 
+3
05 Oct '12 at 10:55
source share

PDFSplit contains all the examples you need. :)

 PDFSplit -split 1 sample_with_13_pages.pdf 

.. must do it.

0
Oct 05
source share



All Articles