Spliting a PDF file in two at specific page number

há 15 horas

To split a single PDF into two separate files using the Ghostscript (gs) command line, you need to run the command twice: once to extract the first set of pages and once for the second set.

Create the first part (Pages 1 to 10):


gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=10 -sOutputFile=part1.pdf input.pdf


Create the second part (Pages 11 to end):


gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dFirstPage=11 -sOutputFile=part2.pdf input.pdf