Package Details: pdfcropmargins 2.2.0-3

Git Clone URL: https://aur.archlinux.org/pdfcropmargins.git (read-only, click to copy)
Package Base: pdfcropmargins
Description: Automatically crops the margins of PDF files
Upstream URL: https://pypi.org/project/pdfCropMargins/
Licenses: GPL
Conflicts: python-pysimplegui
Submitter: zoe
Maintainer: zoe
Last Packager: zoe
Votes: 3
Popularity: 0.081829
First Submitted: 2020-04-01 23:06 (UTC)
Last Updated: 2025-01-19 18:19 (UTC)

Latest Comments

1 2 Next › Last »

loserMcloser commented on 2025-06-06 20:02 (UTC) (edited on 2025-06-06 20:02 (UTC) by loserMcloser)

  • You shouldn't need to use sudo in a PKGBUILD, since the whole point of makepg running in a fakeroot environment is to be able to build packages without root privileges.

  • pip is not recommended in a PKGBUILD: see the Python package guidelines in the wiki.

  • You seem to be confusing depends and makedepends --- I don't think this package depends on python-setuptools or python-wheel at runtime.

Below is a PKGBUILD with these issues corrected, updated to the latest version of pdfcropmargins, and that builds from source instead of from a .whl file (again, as recommended at the Python package guidelines page).

pkgname=pdfcropmargins
pkgver=2.2.1
pkgrel=1
pkgdesc="Automatically crops the margins of PDF files"
url="https://pypi.org/project/pdfCropMargins/"
arch=('any')
license=('GPL')
makedepends=('python-build' 'python-installer' 'python-wheel')
depends=('python-pymupdf' 'python-pypdf')
optdepends=('ghostscript' 'poppler')
conflicts=('python-pysimplegui')
install=${pkgname}.install
source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname//-/_}/${pkgname//-/_}-$pkgver.tar.gz")
sha512sums=('aa5f250d9e82bc28bfa99aecfa2ba36cca5f66b5eeb272ad661fab093bf9393e84213a4bee9f3fa6e06655d7eea94e28d1b2030f3d79a414a9925cc25336487f')

build() {
    cd $pkgname-$pkgver
    python -m build --wheel --no-isolation
}

package() {
    cd $pkgname-$pkgver
    python -m installer --destdir="$pkgdir" dist/*.whl
}

metoj commented on 2024-12-30 12:44 (UTC) (edited on 2024-12-30 12:48 (UTC) by metoj)

$ pdfcropmargins

Traceback (most recent call last):

File "/usr/bin/pdfcropmargins", line 5, in <module>

from pdfCropMargins.pdfCropMargins import main

ModuleNotFoundError: No module named 'pdfCropMargins'

As an alternative, the python package (installed with pipx) works.

Edit: Solved by reinstalling.

leonclx commented on 2024-11-15 10:02 (UTC) (edited on 2024-11-15 10:04 (UTC) by leonclx)

Getting a permission error. Trying to override permissions with sudo chmod 777 /usr/bin/pdf-crop-margins doesn't work.

Removing existing $pkgdir/ directory...

Entering fakeroot environment...

Starting package()...

Processing ./pdfCropMargins-2.1.4-py2.py3-none-any.whl

Requirement already satisfied: wheel in /usr/lib/python3.12/site-packages (from pdfCropMargins==2.1.4) (0.44.0)

Requirement already satisfied: pillow>=10.1.0 in /usr/lib/python3.12/site-packages (from pdfCropMargins==2.1.4) (11.0.0)

Requirement already satisfied: PyMuPDF>=1.19.6 in /usr/lib/python3.12/site-packages (from pdfCropMargins==2.1.4) (1.24.13)

Installing collected packages: pdfCropMargins

Attempting uninstall: pdfCropMargins

Found existing installation: pdfCropMargins 2.1.2

Uninstalling pdfCropMargins-2.1.2:

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/bin/pdf-crop-margins'

Consider using the --user option or check the permissions.

ERROR: A failure occurred in package().

Aborting...

error: failed to build 'pdfcropmargins-2.1.4-1':

Marcouney commented on 2024-10-26 23:04 (UTC)

Options --no-dependencies --ignore-installed should be added to pip command.

moetayuko commented on 2024-05-24 15:17 (UTC)

@zoe I modified PKGBUILD to build the package from source rather than using the prebuilt one from pypi (as most arch python packages do) https://fars.ee/kVSJ

meanwhile, python-pysimplegui from aur can still be used because the maintainer is unlikely to upgrade to the non-free version.

loserMcloser commented on 2024-05-18 19:14 (UTC)

PKGBUILD for version 2.1.2

begin-theadventu commented on 2023-09-03 20:07 (UTC)

@zoe Do you plan to update this package?

ilario commented on 2023-08-10 12:31 (UTC)

It complains that PyPDF2 is not available even if python-pypdf2 was installed as a dependency:

Error in pdfCropMargins: No system PyPDF2 Python package was found. Reinstall pdfCropMargins via pip or install that dependency ('pip install pypdf2').

$ pacman -Q python-pypdf2 python-pypdf2 1:2.12.1-3

Checking on the upstream repository, since the version 2.0.0 the dependency to PyPDF2 is not needed. So, a possible fix is to update this AUR entry.

zoe commented on 2021-01-09 23:57 (UTC)

@victorgv : I cannot reproduce your error. For me, it does work well, and my archlinux is up-to-date…