A PDF processor written in Go.
View the Project on GitHub pdfcpu/pdfcpu
Generate a trimmed version of inFile
for selected pages. Have a look at some examples.
pdfcpu trim -p(ages) selectedPages inFile [outFile]
name | description | required |
---|---|---|
p(ages) | selected pages | yes |
name | description | values |
---|---|---|
v(erbose) | turn on logging | |
vv | verbose logging | |
q(uiet) | quiet mode | |
-o(ffline) | disable http traffic | |
c(onf) | config dir | $path, disable |
opw | owner password | |
upw | user password | |
u(nit) | display unit | po(ints),in(ches),cm,mm |
name | description | required | default |
---|---|---|---|
inFile | PDF input file | yes | |
outFile | PDF output file | no | inFile |
The following PDF elements are not carried over into the trimmed document:
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