Trim
Generate a trimmed version of inFile
for selected pages. Have a look at some examples.
Usage
pdfcpu trim [-v(erbose)|vv] -pages pageSelection [-upw userpw] [-opw ownerpw] inFile [outFile]
Flags
flag | description | required |
---|---|---|
verbose | turn on logging | no |
vv | verbose logging | no |
pages | page selection | yes |
upw | user password | no |
opw | owner password | no |
Arguments
name | description | required | default |
---|---|---|---|
inFile | PDF input file | yes | |
outFile | PDF output file | no | inFile_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:
pdfcpu trim -pages even test.pdf test_trimmed.pdf
Create a single page PDF file for a specific page number:
pdfcpu trim -pages 1 test.pdf firstPage.pdf
Get rid of the catalog and trailing index:
pdfcpu trim -pages '!2-4,!12-' book.pdf essence.pdf