From patchwork Thu Sep 7 23:32:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 53670 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AB74827BBEA; Fri, 8 Sep 2023 00:33:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9E3F527BBE2 for ; Fri, 8 Sep 2023 00:33:33 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeOUh-0001gX-LR; Thu, 07 Sep 2023 19:33:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeOUf-0001fu-6b for guix-patches@gnu.org; Thu, 07 Sep 2023 19:33:01 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeOUe-0006Zs-UK for guix-patches@gnu.org; Thu, 07 Sep 2023 19:33:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qeOUg-0000V8-Ie for guix-patches@gnu.org; Thu, 07 Sep 2023 19:33:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65806] [PATCH 3/4] gnu: Add pdf-crop-margins. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 07 Sep 2023 23:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65806 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65806@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 65806-submit@debbugs.gnu.org id=B65806.16941295571875 (code B ref 65806); Thu, 07 Sep 2023 23:33:02 +0000 Received: (at 65806) by debbugs.gnu.org; 7 Sep 2023 23:32:37 +0000 Received: from localhost ([127.0.0.1]:41736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeOUH-0000U5-65 for submit@debbugs.gnu.org; Thu, 07 Sep 2023 19:32:37 -0400 Received: from 13.mo582.mail-out.ovh.net ([188.165.56.124]:39309) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeOUB-0000TR-RZ for 65806@debbugs.gnu.org; Thu, 07 Sep 2023 19:32:34 -0400 Received: from director10.ghost.mail-out.ovh.net (unknown [10.108.16.222]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 5E73424544 for <65806@debbugs.gnu.org>; Thu, 7 Sep 2023 23:32:28 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-pv2nq (unknown [10.110.208.181]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 1CB781FD83; Thu, 7 Sep 2023 23:32:28 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-6684bf9d7b-pv2nq with ESMTPSA id /NtrA4xd+mQiaQQAzeOs4g (envelope-from ); Thu, 07 Sep 2023 23:32:28 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-105G0068dc694d3-834a-43da-ad84-b1bf1b63cf02, DB6F9D30D203583FCBA53150EC9F55B1C5AACDC8) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 Date: Fri, 8 Sep 2023 01:32:12 +0200 Message-ID: <3535c0c58a946e35378224215147e969deba1659.1694129533.git.ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Ovh-Tracer-Id: 6740762743007077090 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrudehiedgvdegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvdehleeiffehtedvlefhffffjeefgfduhfetkeevheeiteduiedugfekuedtheejnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddtheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepieehkedtieesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekvddpmhhouggvpehsmhhtphhouhht X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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")