From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 65806@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#65806] [PATCH 3/4] gnu: Add pdf-crop-margins.
Date: Fri, 8 Sep 2023 01:32:12 +0200 [thread overview]
Message-ID: <3535c0c58a946e35378224215147e969deba1659.1694129533.git.ngraves@ngraves.fr> (raw)
In-Reply-To: <bc8af8e30e35ffdd7e31970ebb021dea978cdcbe.1694129533.git.ngraves@ngraves.fr>
* gnu/packages/pdf.scm (pdf-crop-margins): New variable.
---
gnu/packages/pdf.scm | 57 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 30cc325d48..2266296621 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -964,6 +964,63 @@ (define-public python-pymupdf
analysis, conversion & manipulation of PDF (and other) documents.")
(license license:agpl3+)))
+(define-public pdf-crop-margins
+ (let ((commit "6d89093e33e98ab02196cfc5e06e96003771e735")
+ (revision "0"))
+ (package
+ (name "pdf-crop-margins")
+ (version "2.0.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/abarker/pdfCropMargins")
+ ;; Releases are not in git tags.
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0144px9kl927z6gx380i2sd75izqzxnnzl3laih2dwpqp82r9j6f"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'lift-requirements
+ (lambda _
+ (substitute* "setup.py"
+ (("pillow>=9\\.3\\.0") ; security issues handled by a patch
+ "pillow>=9.2.0")))))))
+ (native-inputs (list python-setuptools
+ python-pillow))
+ (propagated-inputs (list ghostscript
+ python-pymupdf
+ python-pysimplegui))
+ (home-page "https://github.com/abarker/pdfCropMargins")
+ (synopsis "Automatically crop the margins of PDF files")
+ (description "The pdfCropMargins program is a command-line application to
+automatically crop the margins of PDF files. Cropping the margins can make it
+easier to read the pages of a PDF document -- whether the document is printed
+or displayed on a screen -- because the display fonts are larger.
+
+Features
+@itemize
+@item Automatically detects the margins and can crop a given percentage of them.
+@item Can crop all the pages to the same size to give a uniform appearance.
+@item Renders and analyzes page images to find the bounding boxes, which allows
+it to deal with noisy scanned PDFs.
+@item A rudimentary 'undo' capability is implemented by default.
+@item Can crop pages uniformly based on the nth smallest crop values, to help
+with noisy documents where a few pages have unwanted markings in their margins.
+@item Can automatically run a document previewer on the output file.
+@item The format of automatically-generated output-file names is modifiable.
+@item Preserves document catalog information such as outlines if possible.
+@item Crops rotated pages according to their appearance in the document viewer.
+@item Can deal with at least simple cases of password-encrypted files.
+@item Can automatically apply a Ghostscript repair operation to attempt to fix
+corrupt PDF files.
+@end itemize")
+ (license license:gpl3+))))
+
(define-public qpdf
(package
(name "qpdf")
--
2.41.0
next prev parent reply other threads:[~2023-09-07 23:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-07 15:18 [bug#65806] [PATCH 0/4 pdf-crop-margins python package] Nicolas Graves via Guix-patches via
2023-09-07 23:32 ` [bug#65806] [PATCH 1/4] gnu: Add python-pymupdf Nicolas Graves via Guix-patches via
2023-09-07 23:32 ` [bug#65806] [PATCH 2/4] gnu: Add python-pysimplegui Nicolas Graves via Guix-patches via
2023-09-07 23:32 ` Nicolas Graves via Guix-patches via [this message]
2023-09-07 23:32 ` [bug#65806] [PATCH 4/4] gnu: Add pdf-crop-margins-cli Nicolas Graves via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3535c0c58a946e35378224215147e969deba1659.1694129533.git.ngraves@ngraves.fr \
--to=guix-patches@gnu.org \
--cc=65806@debbugs.gnu.org \
--cc=ngraves@ngraves.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.