
Source (link to git-repo or to original if based on someone elses unmodified work): https://github.com/arminstraub/krop
krop is a simple graphical tool to crop the pages of PDF files.
It is written in Python and relies on PyQT, python-poppler-qt4 and pyPDF for its functionality.
A unique feature of krop is its ability to automatically split pages into subpages to fit the limited screen size of devices such as eReaders. This is particularly useful, if your eReader does not support convenient scrolling.
Further information and instructions can be found at http://arminstraub.com/software/krop
krop (0.5.0) 2018-02-11 -- Armin Straub 1 year ago
+ Support PyQt5.
+ Use Ghostscript to optionally optimize the final PDF (thanks to Mathias Rav for the idea and code).
krop (0.5.0) 2018-02-11 -- Armin Straub 1 year ago
+ Support PyQt5.
+ Use Ghostscript to optionally optimize the final PDF (thanks to Mathias Rav for the idea and code).
krop (0.4.13) 2017-07-22 -- Armin Straub 1 year ago
+ Added the command line option --go, which outputs a PDF using the choices
from --autotrim, --rotate and --whichpages, without opening the krop GUI
(thanks to Mirko Weihrauch for the idea).
+ Padding for auto trimming can be specified as in CSS using one to four
values. This option is now also available on the command line as
--autotrim-padding. (Thanks to Jonah Langlieb for providing sanity checks!)
* Fix incorrect string handling when opening files from the command line
using python3 (thanks to Giuliano Costantini for observing and fixing this).
krop (0.4.12) 2017-01-22 -- Armin Straub 2 years ago
* Use CropBox instead of MediaBox when determining the region to be cropped (thanks to Tim Mueller for observing and fixing this).
* Use a more proper Python package structure (thanks to Xavier Corredor Llano for advice).
krop (0.4.11) 2016-08-29 -- Armin Straub 2 years ago
* Make krop compatible with both python2 and python3.
5 years ago
krop (0.4.10) 2016-05-29 -- Armin Straub
* When cropping, all PDF page boxes (ArtBox, BleedBox, CropBox, MediaBox,
TrimBox) are now adjusted.
krop (0.4.9) 2015-10-31 -- Armin Straub
* Reading PDF files is less strict now. As a consequence, krop doesn't give
up cropping some files which resulted in an error before.
* Fix a possible crash when starting krop.
krop (0.4.8) 2015-07-04 -- Armin Straub
+ More options are accessible via command line arguments.
* Mouse cursor now changes when over selections and handles.
* Improved visibility of selections.
krop (0.4.7) 2015-02-15 -- Armin Straub
+ Basic options are accessible as command line arguments (run krop with
--help to see available options).
* When pressing ctrl-c in the terminal, krop will shut down (not gracefully,
though; only intended for when there is trouble).
* Avoid hitting Python's recursion limit in the pyPdf library when working
with certain large pdf files (thanks to Victor).
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.
krop (0.4.3) 2013-08-10 -- Armin Straub
* Fix a bug that prevented PDF files to be specified on the command line
(thanks to roctheme for reporting).
* Instead of no icon at all, use the system icon 'edit-cut' as application
icon (thanks to roctheme for the suggestion).
krop (0.4.2) 2013-08-04 -- Armin Straub
+ Use PyKDE if available (though this is not really used yet).
* If default icons are missing, use text instead.
krop (0.4.1) 2013-07-28 -- Armin Straub
* Initial public release.
+ Several small bug fixes.
krop (0.4.0) 2013-06-16 -- Armin Straub
* Rewrote cropping code, resulting in much smaller pdf files.
roctheme
3 years ago
in terminal it works:
krop <filename>
ProblemType: Crash
CurrentDesktop: KDE
Date: Tue Aug 11 08:57:21 2015
ExecutablePath: /usr/share/krop/krop.py
ExecutableTimestamp: 1400944165
InterpreterPath: /usr/bin/python2.7
ProcCmdline: /usr/bin/python /usr/bin/krop /home/user/File.pdf
ProcCwd: /home/user
ProcEnviron:
LANGUAGE=de
PATH=(custom, user)
XDG_RUNTIME_DIR=<set>
LANG=de_DE.UTF-8
SHELL=/bin/bash
...
krop.py crashed with TypeError in main(): decode() argument 1 must be string, not None
Report
arminstraub
3 years ago
The following should fix the crash: in krop.py, replace the line
fileName = args.file.decode(sys.stdin.encoding)
with
fileName = args.file.decode(sys.stdin.encoding or sys.getdefaultencoding())
Please let me know if this does not work as intended.
This change will be included in the next update of krop.
Report
roctheme
3 years ago
Thank you!
Great App.
Report
epsilom
4 years ago
Report
arminstraub
3 years ago
Report
Putin
4 years ago
Report
arminstraub
4 years ago
Report
OdinEidolon
4 years ago
Traceback (most recent call last):
File "/usr/bin/krop", line 19, in <module>
krop.krop.main()
File "/usr/lib/python2.7/site-packages/krop/krop.py", line 54, in main
from mainwindow import MainWindow
File "/usr/lib/python2.7/site-packages/krop/mainwindow.py", line 30, in <module>
from vieweritem import ViewerItem
File "/usr/lib/python2.7/site-packages/krop/vieweritem.py", line 20, in <module>
from popplerqt4 import Poppler
RuntimeError: the sip module implements API v11.0 but the popplerqt4 module requires API v10.1
Report
arminstraub
4 years ago
Not sure what may have caused the problem; does the suggestion at https://groups.google.com/forum/#!topic/frescobaldi/ViHxQpW4470 make sense to you?
Report
OdinEidolon
5 years ago
I also have the bug which prevents Krop to be used via the right-clivk "open with" menu.
Three more suggestions in order of importance:
1) Provide a way to allow to crop many different pdf files with the same cropping geometry/selection. Or at least speed up the process. (eg: option to remember output folder and cropping region for the next file, and button to open the next file in the working folder)
2)Provide a button to automatically select a region without having to do it manually. Okular does have such a button that says "trim margins".
3)Krop seems to forget, if closed and reopened, the last opened files and their folder.
Thank you!
Report
arminstraub
5 years ago
Report
arminstraub
4 years ago
Report
nitsnatsnok
5 years ago
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 26: ordinal not in range(128)
Great program, thanks a lot!!!
Report
arminstraub
5 years ago
Report
roctheme
5 years ago
Debian Package work with Kubuntu 13.04 too.
Report
roctheme
5 years ago
e.g.: krop /home/user/Dokumente/test.pdf
krop: Unexpected argument '/home/user/Dokumente/test.pdf'.
krop: Use --help to get a list of available command line options.
Report
arminstraub
5 years ago
The bug you mention will be fixed in the next version.
(To fix this silly regression right now you can replace the line 'KCmdLineArgs.init (sys.argv, aboutData)' in krop.py by the line 'KCmdLineArgs.init(aboutData)'.)
Report
roctheme
5 years ago
KCmdLineArgs.init(aboutData) fixes the command line problem in Kubuntu.
context menu "open with->krop" now work too in Dolphin.
Note, krop has no icon in Kubuntu. Perhaps you can use this system icon:
Icon=edit-cut
Report
arminstraub
5 years ago
Report
cgonzalez
5 years ago
Report