What is krop?
krop is a simple graphical tool to crop the pages of PDF files.
- The functionality of krop is perhaps best indicated by some screenshots.
- krop should work on any recent Linux distribution, see how to install krop. I don't know if krop can be used on Windows or Mac after a sufficient amount of tinkering: please let me know in case you succeed.
- It is written in Python and relies on PyQT, python-poppler-qt4 and pyPDF for its functionality.
- It is free software, released under GPLv3+ in the sole hope that you or someone else may find it useful.
- A unique feature of krop, at least to my knowledge, is its ability to automatically split pages into subpages to fit the limited screensize of devices such as eReaders. This is particularly useful, if your eReader does not support convenient scrolling. (In fact, I wrote krop to be able to read mathematical papers on my Nook.)
- Possible alternatives to krop include PDF-Shuffler and briss.
- Please report bugs to email@example.com. Patches with improvements would, of course, be wonderful.
|krop 0.4.6||2014/05/24||Armin Straub|
|+||Added option to specify pages which require individual selections (thanks to Roger Krebs for the suggestion and for testing).|
|*||'Trim Margins' automatically creates a region for the full page if no regions exist.|
|*||Reorganized options across tabs.|
|+||Added appdata file (thanks to Richard Hughes).|
|krop 0.4.5||2014/02/01||Armin Straub|
|*||Load and write files with non-ascii characters in their filename.|
|krop 0.4.4||2013/08/18||Armin Straub|
|+||If available use PyPDF2 in place of pyPdf.|
|*||Correctly crop PDFs which have orientation other than 'portrait' (thanks to Gaetano Pepe for sending sample PDFs and testing).|
|*||In case of more than one selection per page, cropping is much faster now and results in smaller files.|
|*||Delete old selections when opening a new file.|
Please read below how to install krop, if you are unsure which file to download.
|krop-0.4.6.tar.gz||29.34 KB||krop 0.4.6 (source code)||597|
|krop-0.4.6.ebuild||800 Bytes||krop 0.4.6 (Gentoo ebuild)||135|
|krop_0.4.6-1_all.deb||18.59 KB||krop 0.4.6 (Debian package)||1503|
|krop-0.4.5.tar.gz||28.01 KB||krop 0.4.5 (source code)||431|
|krop-0.4.5.ebuild||831 Bytes||krop 0.4.5 (Gentoo ebuild)||181|
|krop_0.4.5-1_all.deb||16.92 KB||krop 0.4.5 (Debian package)||1190|
You should be able to install krop on any recent Linux distribution. The following distributions already include krop:
- On Fedora all you need (thanks to Christopher Meng) is:
$ yum install krop
- On Gentoo it suffices (thanks to Andreas Huettel) to run (you might be asked to enable experimental packages):
$ emerge krop
On the other hand, Debian packages are available for distributions based on Debian, which further includes kubuntu, Ubuntu and Linux Mint. Finally, you can install krop from sources on any distribution such as Arch.
After installing krop by one of these methods, it should be available on the command line as
krop and you can call it without parameters or with one parameter specifying the PDF file you would like to open. If you install krop using the Debian package (which is recommended as it allows for easy uninstalling), it should also become available in the desktop menu as well as in the context menu of PDF files.
Install from Debian package
The following instructions have been tested using a standard installation of kubuntu, version 12.10 or higher, as well as Linux Mint, version 15 KDE. Little adjustment should be needed for other Debian-based distributions.
For this approach you need to download only a Debian package, say, krop_0.4.6-1_all.deb.
If gdebi is installed (its command line version resides in the package gdebi-core), then
$ sudo gdebi krop_0.4.6-1_all.debshould be sufficient.
Otherwise, we install the dependencies by hand, that is:
$ sudo apt-get install python-poppler-qt4 python-pypdf $ sudo dpkg -i krop_0.4.6-1_all.deb
Install from source package
It should then be sufficient to download the source package, say krop-0.4.6.tar.gz, and issue something along the lines of:
$ tar xzf krop-0.4.6.tar.gz $ cd krop-0.4.6 $ sudo python setup.py install
Note that you can also test krop without installing it: extract the sources, change into the krop-0.4.6 directory and execute
If you wish to install krop into the desktop menu, you can either do this by hand or use the included krop.desktop file:
$ xdg-desktop-menu install --novendor krop.desktopIt may take a while for the menu entry to appear.
A few tricks
- If you press
Trim Marginson a page without selections, then
kropwill automatically create a region for the full page with the margins trimmed.
- If you are cropping a PDF file with many pages, then you may have some exceptional pages which need to be cropped in a different way then the other pages. In that case, the option
Selections apply towill be useful to you.
- To add the dimensions of your own eReader to the 'Fit screen of device' choices, you can edit the configuration file. The location of this file may differ from system to system, but a good place to start looking is ~/.config/arminstraub.com/krop.conf. Don't forget to adjust the counter
size=after adding your entries in the
- If you crop a large pdf file and you run into an error regarding the python recursive limit being exceeded, you can try to add something like
import sys sys.setrecursionlimit(10000)to krop.py. Thanks, Victor, for reporting this possible issue and for suggesting this fix!
|+||Preserve table of contents or bookmarks when cropping|
|+||Is there a clean solution to shut down on CTRL+c? (see http://stackoverflow.com/questions/4938723/)|
|+||Option to overlay pages in order to improve making selections|
|+||Better support for handling a large number of files|