pdfcpu

Logo

A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu


Changelog

Cut


Usage

pdfcpu cut [-p(ages) selectedPages] -- description inFile outDir [outFileName]


Flags

name description required
p(ages) selected pages no


Common Flags

name description values
v(erbose) turn on logging  
vv verbose logging  
q(uiet) quiet mode  
u(nit) display unit po(ints),in(ches),cm,mm
c(onf) config dir $path, disable
upw user password  
opw owner password  


Arguments

name description required
description configuration string yes
inFile PDF input file yes
outDir output directory yes
outFileName PDF output file name no


Description

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


Examples

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