How to install Krop (PDF Crop Tool) in Ubuntu 16.04
To install Krop (PDF Crop Tool) in Ubuntu 16.04
Krop is a free and open source simple and lightweight graphical PDF crop tool software. Krop is a simple graphical tool to crop the pages of PDF files into sub-pages. It is written in Python and relies on PyQT, python-poppler-qt4 and pyPDF for its functionality. A unique feature of krop is automatically split pages into subpages to fit the devices such as eReaders. This tutorial covers the installation procedure of Krop (PDF Crop Tool) in Ubuntu 16.04.
Installation Procedure
To begin the installation procedure, download the krop installation package by running the wget command followed by the download link.
root@example:/home/user1/Desktop# wget http://arminstraub.com/downloads/krop/krop_0.4.11-1_all.deb
--2017-10-06 06:07:33-- http://arminstraub.com/downloads/krop/krop_0.4.11-1_all.deb
Resolving arminstraub.com (arminstraub.com)... 107.191.102.54
Connecting to arminstraub.com (arminstraub.com)|107.191.102.54|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18058 (18K) [application/octet-stream]
Saving to: ‘ krop_0.4.11-1_all.deb’
krop_0.4.11-1_all.deb 100%[===============================================> ] 17.63K --.-KB/s in 0.001s
2017-10-06 06:07:35 (12.5 MB/s) - ‘ krop_0.4.11-1_all.deb’ saved [18058/18058]
Next install the dependency packages for krop by executing the following command.
root@example:/home/user1/Desktop# apt-get install python-poppler-qt4 python-pypdf2
Reading package lists... Done
Building dependency tree
Reading state information... Done
&hellip
&hellip
&hellip
Setting up python-qt4 (4.11.4+dfsg-1build4) ...
Setting up python-poppler-qt4 (0.24.0-1build1) ...
Setting up python-pypdf2 (1.25.1-1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Now install the krop package by executing it with dpkg command.
root@example:/home/user1/Desktop# dpkg -i krop_0.4.11-1_all.deb
Selecting previously unselected package krop.
(Reading database ... 204937 files and directories currently installed.)
Preparing to unpack krop_0.4.11-1_all.deb ...
Unpacking krop (0.4.11-1) ...
Setting up krop (0.4.11-1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...
The krop application is installed in the target machine. To open krop, run the following command.
root@example:/home/user1/Desktop# krop
The Krop application is running, now add the PDF file from local system.
Specify the pages to include for crop.
Select any of the drop down options in the rotate final PDF option.
Choose the selections apply to option of any of the three options.
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-qt5 and PyPDF2 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 mail@arminstraub.com. Patches with improvements would, of course, be wonderful.
"https://github.com/arminstraub/krop".
$ tar xzf krop-0.5.0.tar.gz
$ cd krop-0.5.0
$ sudo python setup.py
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 Exceptions under Selections apply to will be useful to you.
You can use krop --go on the command line (without the GUI) to automatically
extract certain pages,
rotate pages, or
trim empty margins (the margins are determined from the --initial page).
For instance:
$ krop --go --rotate 90 --autotrim -o ~/output.pdf input.pdf
To get around the error "cannot connect to X server", you can prefix this command with xvfb-run (in the package xvfb on Debian and Ubuntu).
Run krop with --help to get a list of all possible arguments (for instance, --initial page 5 starts krop with the fifth page open).
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 device type section.
If you run into the error "multiple definitions in a dictionary" while cropping a file, then this is because pyPdf is too strict. You can either upgrade to PyPDF2 or proceed as indicated in this bug report.