I want to exctact pages from a pdf document such that all pages are extracted except the first one and the last one.
Code but (end-1) does not work, nor 2-end-1
pdftk 1.pdf cat 2-(end-1) output output.pdf
I want to exctact pages from a pdf document such that all pages are extracted except the first one and the last one.
Code but (end-1) does not work, nor 2-end-1
pdftk 1.pdf cat 2-(end-1) output output.pdf
pdftk yourpdfile.pdf cat 2-r2 output out.pdf
You can define a range and remove pages from it (using ~) to achieve this:
pdftk 1.pdf cat 2-end~end output output.pdf
This tells pdftk cat to take the pages from the second page to the last page included (2-end), and remove the last page from the range (~end). The result is a PDF containing everything apart from the first and last pages of the original.
You can use the following format:
pdftk A=1.pdf cat A2-(n-1) output 'outputfile_p2-p(n-1).pdf'
You ca determine n through :pdftk 1.pdf dump_data | grep NumberOfPages
e,g: n=8
pdftk A=1.pdf cat A2-7 output 'outputfile_p2-p7.pdf'