View Single Post
Old 02-29-2016, 09:06 PM   #310
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 1,273
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by pedronac View Post
Hello,
I need to crop several rectangles from a page.
I try to use the command line (so I do not need to do all the setup over GUI)...
This can be done w/k2pdfopt as well. See the -mode and -cbox options in the command-line usage. Something like so:

Code:
k2pdfopt -mode crop -cbox <cropdims1> -cbox <cropdims2> [...] sourcefile.pdf
example:

Code:
k2pdfopt -mode crop -cbox 1in,1in,2in,3in -cbox 5in,4in,2.5in,3.5in myfile.pdf
This would take a 2x3 inch box, starting 1 inch from the left and 1 inch from the top, on each source page, and create a destination page out of it, followed by a 2.5x3.5 inch box, starting 5 inches from the left and 4 inches from the top of each source page. You can also specify a source page range for each crop box, e.g. -cbox2-10 <cropdims> would apply those crop dimensions to only source pages 2 through 10.
willus is offline   Reply With Quote