delete

Delete pages from an input PDF

Usage

pdftl <input> delete <spec>... output <file> [<option...>]

Details

The delete operation is used to delete pages from one PDF. This operation is performed ‘in-place’ and the output PDF should retain all essential features of the input except the missing pages. So if you want to extract pages 1-5 of a PDF file, then it may be a good idea is use this operation to delete pages 6-end rather than using cat (which would have to create a new PDF file from scratch and graft pages 1-5 from the input file in, using all sorts of trickery).

Examples

Delete the first page

pdftl in.pdf delete 1 output out.pdf

Keep only the first page (by deleting the others)

pdftl in.pdf delete '~1' output out.pdf

Tags: in_place, pages, delete

Source: pdftl.operations.delete

Read online: https://pdftl.readthedocs.io/en/stable/operations/delete.html

Type: Operation