Place Holder Products Code
Bash MySQL
Notes Return of the Fed Login
Admin Control Panel Email Control Panel Product Control Panel Debug Info Beacon Create Snippet Tag Control Panel

Extract specific section of a PDF with Ghostscript

It may sometimes be helpful to be able to quickly split a single PDF, and we can do this by selecting and saving specific portions of a larger PDF.  We can use Ghostscript.

gs -dBATCH -dNOPAUSE -q -dPDFSETTINGS=/prepress -sOutputFile=extracted.pdf -dFirstPage=1 -dLastPage=2 -sDEVICE=pdfwrite <input_file.pdf>

We also take advantage of the dPDFSETTINGS=/prepress optimization which significantly reduces the size of the output file.

The first page in the document is 1, not 0.

Comments:

No Comments Yet!