
A PDF processor written in Go.
View the Project on GitHub pdfcpu/pdfcpu
Custom cut pages horizontally or vertically in any way you want.
The result is packaged into a PDF file in outDir for each selected page containing an outline view followed by pages representing cut tiles.
Have a look at some examples.
pdfcpu cut description inFile outDir [ outFile ] [flags]
| name | description | required |
|---|---|---|
| p(ages) | selected pages | no |
| name | description | required |
|---|---|---|
| description | configuration string | yes |
| inFile | PDF input file | yes |
| outDir | output directory | yes |
| outFileName | PDF output file name | no |
A configuration string to specify the cutlines.
| parameter | description | values |
|---|---|---|
| horizontal | horizontal page cuts at height fraction (origin top left corner) | eg: .25 |
| vertical | vertical page cuts at width fraction (origin top left corner) | eg: .25 .5 |
| margin | margin / glue area in display units | >= 0.0 |
| bgcolor | margin / glue area color value | color |
| border | draw content region border along set margin | on/off, true/false, t/f |
Apply a horizontal page cut at 0.25 height.
Results in a PDF containing 3 PDF pages for each processed page:
$ pdfcpu cut 'hor:.25' test.pdf .
cutting test.pdf into ./ ...
writing test_page_1.pdf



Apply a horizontal page cut at 0.25 height and a vertical page cut at 0.75 width.
Results in a PDF containing 5 pages for each processed page:
$ pdfcpu cut 'hor:.25, vert:.75' test.pdf .
cutting test.pdf into ./ ...
writing test_page_1.pdf



The following has the same effect as: pdfcpu ndown 3 in.pdf outDir:
$ pdfcpu cut 'hor:.33 .66' inFile outDir
The following has the same effect as: pdfcpu ndown 4 in.pdf outDir:
$ pdfcpu cut 'hor:.5, ver:.5' inFile outDir