# split pdf file



## fernandel (Dec 9, 2016)

Hi!

I try to split long pdf.
I try:

```
pdftk old.pdf cat 1-18-end new.pdf
Error: Unexpected text in page range end, here:
   1
   Exiting.
   Acceptable keywords, for example: "even" or "odd".
   To rotate pages, use: "north" "south" "east"
       "west" "left" "right" or "down"
Errors encountered.  No output created.
Done.  Input errors, so no output created.
```
If I use:

```
pdftk old.pdf burst
```
than it split mi page by page but I like to split 20 to 40 pages per one split.

Thank you.


----------



## jrm@ (Dec 9, 2016)

How about using gs  from print/ghostscript9-agpl-base?
`gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=1 -dLastPage=20  -sOutputFile=p1-p20.pdf input.pdf`


----------



## fernandel (Dec 9, 2016)

jrm@ said:


> How about using gs  from print/ghostscript9-agpl-base?
> `gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=1 -dLastPage=20  -sOutputFile=p1-p20.pdf input.pdf`



Thank you very much. It works perfect


----------



## aragats (Dec 10, 2016)

Sometime GUI may be useful to manipulate PDFs. Although there is no port for pdfshuffler (a 47k tarball) but it can be easily installed with a couple dependencies (py27-poppler and py27-pdf which are in ports).


----------

