Giter Site home page Giter Site logo

gocarlos / krop Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 5.0 299 KB

This is a python/Qt app which can be used to crop pdf documents. Small, simple and useful. Copy of the original software Krop by Armin Straub.

Home Page: https://github.com/arminstraub/krop

pdf crop tool pdf-tools python qt snap linux-app linux linux-desktop

krop's Introduction

krop

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.

Build status

Snap Status krop krop Codacy Badge Known Vulnerabilities

Installation

The installation can be done using the terminal or using the software center.

💻 Terminal: sudo snap install krop

🛍 Software center: search for krop in the Software center.

Usage

  1. To start GUI type krop

  2. To start the GUI app without terminal search for krop in the visual menu of your Linux distribution.

  3. To use the app without GUI: krop.krop-app --help

Or consult Armin's webpage

Disclaimer

This software was written by Armin Straub and packaged as Linux snap app by Carlos Gomes. This software is sand-boxed with the confinement strict, meaning can only access your home directory & removable media to read/write the pdf files.

Armin has also debian and gentoo packages available on this website.

krop's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

krop's Issues

snapped krop crashed with "TypeError: QLineEdit.setText(str): argument 1 has unexpected type 'tuple'"

Bug Reproduction Info

  • I was editing the filename in the save file dialog
  • The bug is produced under the condition that no input file is opened(at the time I didn't notice there's an Open button on the menu/toolbar

Console Output

$ snap run krop.krop-app
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: MESA-LOADER: failed to retrieve device information
"Qt Warning: Compose file: \"/usr/share/X11/locale/en_US.UTF-8/Compose\" can't be found"
Traceback (most recent call last):
  File "/snap/krop/104/lib/python3.5/site-packages/krop/mainwindow.py", line 236, in slotSelectFile
    self.ui.editFile.setText(fileName)
TypeError: QLineEdit.setText(str): argument 1 has unexpected type 'tuple'
已經終止 (core dumped)

Additional Info

  • I am using an input method framework called Fcitx

  • The host's locale settings:

      LANG=zh_TW.UTF-8
      LANGUAGE=zh_TW:zh_CN
      LC_CTYPE="zh_TW.UTF-8"
      LC_NUMERIC="zh_TW.UTF-8"
      LC_TIME="zh_TW.UTF-8"
      LC_COLLATE="zh_TW.UTF-8"
      LC_MONETARY="zh_TW.UTF-8"
      LC_MESSAGES="zh_TW.UTF-8"
      LC_PAPER="zh_TW.UTF-8"
      LC_NAME="zh_TW.UTF-8"
      LC_ADDRESS="zh_TW.UTF-8"
      LC_TELEPHONE="zh_TW.UTF-8"
      LC_MEASUREMENT="zh_TW.UTF-8"
      LC_IDENTIFICATION="zh_TW.UTF-8"
      LC_ALL=
    

Can it export to PDF 1.7?

I am using my PDF's for web concent and anything less than PDF 1.7 is not usable for the web as it cannot be "streamed" (loaded in chunks). Do you plan to add this feature via Ghostscript? Speaking of Ghostscript do you plan to at least let us add custom Ghostscript code to customize the optimization? Thanks

Failed to install krop on Raspberry Pi

pi@raspberrypi:~ $ sudo snap install krop
error: cannot perform the following tasks:
- Ensure prerequisites for "krop" are available (cannot install prerequisite "kde-frameworks-5-core18": no snap revision available as specified)

CD75E8FD-8B10-4716-9A08-329E9CB5803F

I noticed that kde-frameworks-5-core18 is only available for amd64.

Fail messages starting snap from command line

Some fail messages appear when we start the recently installed krop snap from bash command line

Enviroment

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Sanp list

Name                     Version                     Rev    Tracking         Publisher     Notes
core                     16-2.47.1                   10185  latest/stable    canonical✓    core
core18                   20200929                    1932   latest/stable    canonical✓    base
dbeaver-ce               7.2.5.202011152110          92     latest/stable    dbeaver-corp  -
gnome-3-28-1804          3.28.0-19-g98f9e67.98f9e67  145    latest/stable    canonical✓    -
gnome-3-34-1804          0+git.3556cb3               60     latest/stable/…  canonical✓    -
gtk-common-themes        0.1-44-gb73fa2d             1513   latest/stable/…  canonical✓    -
kde-frameworks-5-core18  5.61.0                      32     latest/stable    kde✓          -
krop                     0.6.0                       159    latest/stable    gocarlos      -
miro                     1.0.0                       2      latest/edge      lukewh        -
nmap                     7.91                        1849   latest/stable    maxiberta     -
postman                  7.36.0                      129    latest/stable    postman-inc✓  -
snap-store               3.38.0-55-geb45541          498    latest/stable/…  canonical✓    -
snapd                    2.47.1                      9721   latest/stable    canonical✓    snapd
spotify                  1.1.46.916.g416cacf1        43     latest/stable    spotify✓      -
zeplin-lukewh            1.0.0                       3      latest/stable    lukewh        -

Log

edu@mco:~$ sudo snap install krop
[sudo] senha para edu: 
krop 0.6.0 from Carlos Gomes Martinho (gocarlos) installed
edu@mco:~$ krop
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.a11y.applications.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.a11y.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.a11y.keyboard.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.a11y.magnifier.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.a11y.mouse.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.app-folders.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.background.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.calendar.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.datetime.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.default-applications.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.enums.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.input-sources.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.lockdown.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.media-handling.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.notifications.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.peripherals.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.privacy.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.screensaver.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.search-providers.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.session.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.sound.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.thumbnail-cache.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.thumbnailers.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.wm.keybindings.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.desktop.wm.preferences.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.system.locale.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.system.location.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/org.gnome.system.proxy.gschema.xml': File exists
ln: failed to create symbolic link '/home/edu/snap/krop/159/.local/share/glib-2.0/schemas/10_gsettings-desktop-schemas.gschema.override': File exists
[error] cannot open locale definition file `pt': No such file or directory
[error] cannot open locale definition file `en': No such file or directory
Qt: Session management error: None of the authentication protocols specified are supported
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: MESA-LOADER: failed to retrieve device information

Interface is old

I know it's based on Qt 4, so is there a way to use Oxygen theme instead of some old-fashioned theme from the late 90s?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.