Trim

Generate a trimmed version of inFile for selected pages. Have a look at some examples.

Usage

  1. pdfcpu trim [-v(erbose)|vv] -pages pageSelection [-upw userpw] [-opw ownerpw] inFile [outFile]

Flags

flagdescriptionrequired
verboseturn on loggingno
vvverbose loggingno
pagespage selectionyes
upwuser passwordno
opwowner passwordno

Arguments

namedescriptionrequireddefault
inFilePDF input fileyes
outFilePDF output filenoinFile_new.pdf

Restrictions

The following PDF elements are not carried over into the trimmed document:

  • Annotations
  • Outlines
  • Struct Trees
  • Forms

Examples

Get rid of unwanted blank pages:

  1. pdfcpu trim -pages even test.pdf test_trimmed.pdf

Create a single page PDF file for a specific page number:

  1. pdfcpu trim -pages 1 test.pdf firstPage.pdf

Get rid of the catalog and trailing index:

  1. pdfcpu trim -pages '!2-4,!12-' book.pdf essence.pdf