View Single Post
Old 01-10-2009, 05:05 PM   #1
moggie
Enthusiast
moggie is on a distinguished road
 
moggie's Avatar
 
Posts: 34
Karma: 74
Join Date: Nov 2008
Location: Cambridge,UK
Device: sony 505
yet another cropping tool

I recently sent kovid a set of patches which implemented a cropping tool for pdf's for the command line. It was released in yesterdays version Version 0.4.127. Basically you can use it to reduce the page by a set amount or use the output of ghostscript to automatically crop pages.

The usage is :

Code:
pdftrim --help
Usage: pdftrim.py [options] file.pdf

Crops a pdf. 


Whenever you pass arguments to pdftrim.py that have spaces in them, enclose the arguments in quotation marks.

Options:
  --version             show program's version number and exit

  -h, --help            show this help message and exit

  --verbose             Be verbose, useful for debugging. Can be specified
                        multiple times for greater verbosity.

  -o OUTPUT, --output=OUTPUT
                        Path to output file. By default a file is created in
                        the current directory.

  -x BOTTOM_LEFT_X, --leftx=BOTTOM_LEFT_X
                        Number of pixels to crop from the left most x (default
                        is 10)

  -y BOTTOM_LEFT_Y, --lefty=BOTTOM_LEFT_Y
                        Number of pixels to crop from the left most y (default
                        is 10)

  -v TOP_RIGHT_X, --rightx=TOP_RIGHT_X
                        Number of pixels to crop from the right most x
                        (default is 10)

  -w TOP_RIGHT_Y, --righty=TOP_RIGHT_Y
                        Number of pixels to crop from the right most y
                        (default is 10)

  -b BOUNDING, --bounding=BOUNDING
                        A file generated by ghostscript which allows each page
                        to be individually cropped [gs -dSAFER -dNOPAUSE
                        -dBATCH -sDEVICE=bbox > bounding]
Like all of calibre it is free under the gpl. As its part of calibre its not going to get horribly complicated but I hope it will be usefull
moggie is offline   Reply With Quote