pdfcpu

Logo

A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu


Changelog

Trim

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

Usage

pdfcpu trim inFile [outFile] [flags]

Flags

namedescriptionrequired
p(ages)selected pagesyes

Common Flags


Arguments

namedescriptionrequireddefault
inFilePDF input fileyes
outFilePDF output filenoinFile

Restrictions

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


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 -p 1 test.pdf firstPage.pdf

Get rid of the catalog and trailing index:
$ pdfcpu trim book.pdf essence.pdf --pages '!2-4,!12-'