Forrest logo
back to the pdftk tool

pdftk:tldr:4815d

pdftk: Extract pages 1-3, 5 and 6-10 from a PDF file and save them as another one.
$ pdftk ${input-pdf} cat ${1-3 5 6-10} output ${output-pdf}
try on your machine

This command uses a program called pdftk (PDF Toolkit) to perform specific operations on PDF files.

Here is a breakdown of the command:

  • ${input-pdf}: This is a variable that represents the input PDF file. You need to replace ${input-pdf} with the actual file path and name of the input PDF file you want to manipulate.

  • cat: This is the command used to concatenate or combine PDF files.

  • ${1-3 5 6-10}: This is a range specification that selects specific pages from the input PDF file. It will include pages 1, 2, 3, 5, and pages 6 to 10. You can modify this range to include the desired page numbers from the input PDF file.

  • ${output-pdf}: This is a variable that represents the output PDF file. You need to replace ${output-pdf} with the actual file path and name of the output PDF file you want to create.

To use this command, you need to replace ${input-pdf} and ${output-pdf} with the appropriate file paths/names, and adapt the page range ${1-3 5 6-10} based on your specific requirements.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pdftk tool