|
|
#1 |
|
Enthusiast
![]() 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]
|
|
|
|
|
|
#2 |
|
Addict
![]() ![]() ![]() ![]() Posts: 223
Karma: 356
Join Date: Aug 2007
Device: Rocket; Hiebook; N700; Sony 505; Kindle DX ...
|
Thank you for your useful tool, it arrives at the right time - I need to trim out a "slice" from each page of a book I scanned.
I got the tool from the latest calibre install, so I don't know if the problem comes from the tool itself or from calibre, anyway here is the output: > pdftrim -x 100 "Marazzini - La rilegatura artigianale e d'arte.pdf" Traceback (most recent call last): File "/usr/bin/pdftrim", line 8, in <module> load_entry_point('calibre==0.4.127', 'console_scripts', 'pdftrim')() File "build/bdist.linux-i686/egg/calibre/ebooks/pdf/pdftrim.py", line 56, in main AttributeError: 'NoneType' object has no attribute 'title' not knowing python, it's hard for me to decode the error... thanks for any help! alessandro |
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Enthusiast
![]() Posts: 34
Karma: 74
Join Date: Nov 2008
Location: Cambridge,UK
Device: sony 505
|
Quote:
If you can set a title and author on the source pdf that will probably fix the problem now. http://calibre.kovidgoyal.net/ticket/1617 Last edited by moggie; 01-14-2009 at 04:22 PM. Reason: adding ticket number |
|
|
|
|
|
|
#4 | |
|
Enthusiast
![]() Posts: 34
Karma: 74
Join Date: Nov 2008
Location: Cambridge,UK
Device: sony 505
|
Quote:
|
|
|
|
|
|
|
#5 |
|
Addict
![]() ![]() ![]() ![]() Posts: 223
Karma: 356
Join Date: Aug 2007
Device: Rocket; Hiebook; N700; Sony 505; Kindle DX ...
|
Thank you a lot,
it works flawlessly now. Alessandro |
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cropping Multiple Files | SpyKiIIer | 16 | 12-07-2012 01:09 AM | |
| Cropping PDFs | harryo | iRex | 33 | 11-20-2009 11:41 AM |
| cropping pdf with preview | wang960 | Sony Reader | 2 | 05-05-2009 10:28 AM |
| Yet another PDF cropping tool | sjvr767 | iRex | 7 | 02-14-2009 08:04 AM |
| Nice Mac OS X .pdf Cropping Tool | jmdor | Sony Reader | 0 | 04-04-2007 11:41 PM |