summaryrefslogtreecommitdiff
path: root/gnu/packages/pdf.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/pdf.scm')
-rw-r--r--gnu/packages/pdf.scm112
1 files changed, 111 insertions, 1 deletions
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index bfb457fcb3..9c6e9a967e 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -491,7 +491,14 @@ extracting content or merging files.")
(patches (search-patches "mupdf-build-with-openjpeg-2.1.patch"
"mupdf-CVE-2016-6265.patch"
"mupdf-CVE-2016-6525.patch"
- "mupdf-CVE-2016-8674.patch"))
+ "mupdf-CVE-2016-7504.patch"
+ "mupdf-CVE-2016-7505.patch"
+ "mupdf-CVE-2016-7506.patch"
+ "mupdf-CVE-2016-7563.patch"
+ "mupdf-CVE-2016-7564.patch"
+ "mupdf-CVE-2016-8674.patch"
+ "mupdf-CVE-2016-9017.patch"
+ "mupdf-CVE-2016-9136.patch"))
(modules '((guix build utils)))
(snippet
;; Delete all the bundled libraries except for mujs, which is
@@ -778,3 +785,106 @@ the framebuffer.")
(description "@command{pdf2svg} is a simple command-line PDF to SVG
converter using the Poppler and Cairo libraries.")
(license license:gpl2+)))
+
+(define-public python-pypdf2
+ (package
+ (name "python-pypdf2")
+ (version "1.26.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyPDF2" version))
+ (sha256
+ (base32
+ "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after
+ 'unpack 'patch-test-suite
+ (lambda _
+ ;; The text-file needs to be opened in binary mode for Python 3,
+ ;; so patch in the "b"
+ (substitute* "Tests/tests.py"
+ (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
+ (string-append line "b")))
+ #t))
+ (replace 'check
+ (lambda _
+ (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))
+ (home-page "http://mstamy2.github.com/PyPDF2")
+ (synopsis "Pure Python PDF toolkit")
+ (description "PyPDF2 is a pure Python PDF library capable of:
+
+@enumerate
+@item extracting document information (title, author, …)
+@item splitting documents page by page
+@item merging documents page by page
+@item cropping pages
+@item merging multiple pages into a single page
+@item encrypting and decrypting PDF files
+@end enumerate
+
+By being pure Python, it should run on any Python platform without any
+dependencies on external libraries. It can also work entirely on
+@code{StringIO} objects rather than file streams, allowing for PDF
+manipulation in memory. It is therefore a useful tool for websites that
+manage or manipulate PDFs.")
+ (license license:bsd-3)))
+
+(define-public python2-pypdf2
+ (package-with-python2 python-pypdf2))
+
+(define-public python2-pypdf
+ (package
+ (name "python2-pypdf")
+ (version "1.13")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "pyPdf" version))
+ (sha256
+ (base32
+ "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f ; no tests
+ #:python ,python-2))
+ (home-page "http://pybrary.net/pyPdf/")
+ (synopsis "Pure Python PDF toolkit")
+ (description "PyPDF2 is a pure Python PDF toolkit.
+
+Note: This module isn't maintained anymore. For new projects please use
+python-pypdf2 instead.")
+ (license license:bsd-3)))
+
+(define-public pdfposter
+ (package
+ (name "pdfposter")
+ (version "0.6.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "pdftools.pdfposter" version ".tar.bz2"))
+ (sha256
+ (base32
+ "1i9jqawf279va089ykicglcq4zlsnwgcnsdzaa8vnm836lqhywma"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f ; no test suite, only for visual control
+ #:python ,python-2))
+ (inputs
+ ;; pdfposter 0.6.0 still uses the old pyPdf
+ `(("python2-pypdf" ,python2-pypdf)))
+ (native-inputs
+ `(("python2-setuptools" ,python2-setuptools)))
+ (home-page "https://pythonhosted.org/pdftools.pdfposter/")
+ (synopsis "Scale and tile PDF images/pages to print on multiple pages")
+ (description "@command{pdfposter} can be used to create a large poster by
+building it from multple pages and/or printing it on large media. It expects
+as input a PDF file, normally printing on a single page. The output is again
+a PDF file, maybe containing multiple pages together building the poster. The
+input page will be scaled to obtain the desired size.
+
+This is much like @command{poster} does for Postscript files, but working with
+PDF. Since sometimes @command{poster} does not like your files converted from
+PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
+ (license license:gpl3+)))