1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014, 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
6 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
7 ;;; Coypright © 2016 ng0 <ng0@we.make.ritual.n0.is>
8 ;;; Coypright © 2016 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Coypright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Coypright © 2016 Ludovic Courtès <ludo@gnu.org>
11 ;;; Coypright © 2016 Julien Lepiller <julien@lepiller.eu>
12 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
13 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
14 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages pdf)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix utils)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system python)
39 #:use-module (guix build-system trivial)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages bash)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages fontutils)
46 #:use-module (gnu packages game-development)
47 #:use-module (gnu packages ghostscript)
48 #:use-module (gnu packages databases)
49 #:use-module (gnu packages djvu)
50 #:use-module (gnu packages gettext)
51 #:use-module (gnu packages backup)
52 #:use-module (gnu packages lesstif)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages xdisorg)
55 #:use-module (gnu packages imagemagick)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages photo)
58 #:use-module (gnu packages image)
59 #:use-module (gnu packages pkg-config)
60 #:use-module (gnu packages qt)
61 #:use-module (gnu packages xorg)
62 #:use-module (gnu packages gnome)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages lua)
66 #:use-module (gnu packages curl)
67 #:use-module (gnu packages pcre)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages sdl)
71 #:use-module (gnu packages tls)
72 #:use-module (srfi srfi-1))
74 (define-public poppler
80 (uri (string-append "https://poppler.freedesktop.org/poppler-"
84 "0dmwnh59m75vhii6dw63x8l0qa0ha733pb8bdqzr7lw9nwc37jf9"))))
85 (build-system gnu-build-system)
88 (inputs `(("fontconfig" ,fontconfig)
89 ("freetype" ,freetype)
94 ("openjpeg-1" ,openjpeg-1) ; prefers openjpeg-1
97 ;; To build poppler-glib (as needed by Evince), we need Cairo and
98 ;; GLib. But of course, that Cairo must not depend on Poppler.
99 ("cairo" ,(package (inherit cairo)
100 (inputs (alist-delete "poppler"
101 (package-inputs cairo)))))
104 `(("pkg-config" ,pkg-config)
105 ("glib" ,glib "bin") ; glib-mkenums, etc.
106 ("gobject-introspection" ,gobject-introspection)))
108 `(#:tests? #f ; no test data provided with the tarball
110 '("--enable-xpdf-headers" ; to install header files
113 ;; Saves 8 MiB of .a files.
116 (modify-phases %standard-phases
117 (add-before 'configure 'setenv
120 (string-append (assoc-ref %build-inputs "openjpeg-1")
121 "/include/openjpeg-1.5"
122 ":" (or (getenv "CPATH") "")))
124 (synopsis "PDF rendering library")
126 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
127 (license license:gpl2+)
128 (home-page "https://poppler.freedesktop.org/")))
130 (define-public poppler-qt4
131 (package (inherit poppler)
133 (inputs `(("qt-4" ,qt-4)
134 ,@(package-inputs poppler)))
135 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
137 (define-public poppler-qt5
138 (package (inherit poppler)
140 (inputs `(("qtbase" ,qtbase)
141 ,@(package-inputs poppler)))
143 (substitute-keyword-arguments (package-arguments poppler)
144 ((#:configure-flags flags)
145 `(cons "CXXFLAGS=-std=gnu++11" ,flags))))
146 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
148 (define-public python-poppler-qt4
150 (name "python-poppler-qt4")
155 (uri (string-append "https://pypi.python.org/packages/source/p"
156 "/python-poppler-qt4/python-poppler-qt4-"
160 "0x63niylkk4q3h3ay8zrk3m1xiik0x3hlr4gvj7kswx48qi1vb99"))))
161 (build-system python-build-system)
164 (modify-phases %standard-phases
166 'unpack 'patch-poppler-include-paths
168 (substitute* (find-files "." "poppler-.*\\.sip")
169 (("qt4/poppler-.*\\.h" header)
170 (string-append "poppler/" header)))
173 `(("pkg-config" ,pkg-config)))
175 `(("python-sip" ,python-sip)
176 ("python-pyqt-4" ,python-pyqt-4)
177 ("poppler-qt4" ,poppler-qt4)))
178 (home-page "https://pypi.python.org/pypi/python-poppler-qt4")
179 (synopsis "Python bindings for Poppler-Qt4")
181 "This package provides Python bindings for the Qt4 interface of the
182 Poppler PDF rendering library.")
183 (license license:lgpl2.1+)))
185 (define-public libharu
191 (uri (string-append "https://github.com/libharu/libharu/archive/"
193 (string-join (string-split version #\.) "_")
195 (file-name (string-append name "-" version ".tar.gz"))
198 "1lm4v539y9cb1lvbq387j57sy7yxda3yv8b1pk8m6zazbp66i7lg"))))
199 (build-system gnu-build-system)
202 (list (string-append "--with-zlib="
203 (assoc-ref %build-inputs "zlib"))
204 (string-append "--with-png="
205 (assoc-ref %build-inputs "libpng")))
207 (modify-phases %standard-phases
208 (add-before 'configure 'autogen
209 (lambda _ (zero? (system* "autoreconf" "-vif")))))))
214 `(("autoconf" ,autoconf)
215 ("automake" ,automake)
216 ("libtool" ,libtool)))
217 (home-page "http://libharu.org/")
218 (synopsis "Library for generating PDF files")
220 "libHaru is a library for generating PDF files. libHaru does not support
221 reading and editing of existing PDF files.")
222 (license license:zlib)))
230 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
233 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
234 (build-system gnu-build-system)
235 (inputs `(("freetype" ,freetype)
236 ("gs-fonts" ,gs-fonts)
238 ("libpaper" ,libpaper)
247 `(#:tests? #f ; there is no check target
248 #:parallel-build? #f ; build fails randomly on 8-way machines
250 (list (string-append "--with-freetype2-includes="
251 (assoc-ref %build-inputs "freetype")
252 "/include/freetype2"))
256 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
257 (let* ((install (assoc-ref %standard-phases 'install))
258 (out (assoc-ref outputs "out"))
259 (xpdfrc (string-append out "/etc/xpdfrc"))
260 (gs-fonts (assoc-ref inputs "gs-fonts")))
263 (("/usr/local/share/ghostscript/fonts")
264 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
265 (("#fontFile") "fontFile"))))
267 (synopsis "Viewer for PDF files based on the Motif toolkit")
269 "Xpdf is a viewer for Portable Document Format (PDF) files.")
270 (license license:gpl3) ; or gpl2, but not gpl2+
271 (home-page "http://www.foolabs.com/xpdf/")))
273 (define-public zathura-cb
280 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
284 "1fim4mpm8l2g3msj1vg70ks3c9lrwllv3yh4jv8l9f8k3r19b3l8"))))
285 (native-inputs `(("pkg-config" ,pkg-config)))
286 (propagated-inputs `(("girara" ,girara)))
287 (inputs `(("libarchive" ,libarchive)
289 ("zathura" ,zathura)))
290 (build-system gnu-build-system)
292 `(#:make-flags (list (string-append "PREFIX=" %output)
293 (string-append "PLUGINDIR=" %output "/lib/zathura")
295 #:tests? #f ; Package does not contain tests.
297 (alist-delete 'configure %standard-phases)))
298 (home-page "https://pwmt.org/projects/zathura-cb/")
299 (synopsis "Comic book support for zathura (libarchive backend)")
300 (description "The zathura-cb plugin adds comic book support to zathura
302 (license license:zlib)))
304 (define-public zathura-ps
311 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
315 "1nxbl0glnzpan78fhdfzhkcd0cikcvrkzf9m56mb0pvnwzlwg7zv"))))
316 (native-inputs `(("pkg-config" ,pkg-config)))
317 (propagated-inputs `(("girara" ,girara)))
318 (inputs `(("libspectre" ,libspectre)
320 ("zathura" ,zathura)))
321 (build-system gnu-build-system)
323 `(#:make-flags (list (string-append "PREFIX=" %output)
324 (string-append "PLUGINDIR=" %output "/lib/zathura")
326 #:tests? #f ; Package does not contain tests.
328 (alist-delete 'configure %standard-phases)))
329 (home-page "https://pwmt.org/projects/zathura-ps/")
330 (synopsis "PS support for zathura (libspectre backend)")
331 (description "The zathura-ps plugin adds PS support to zathura
333 (license license:zlib)))
335 (define-public zathura-djvu
337 (name "zathura-djvu")
342 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
346 "0py0ra44f65cg064xzds0qr6vnglj2a5bwhnbwa0dyh2nyizdzmf"))))
347 (native-inputs `(("pkg-config" ,pkg-config)))
348 (propagated-inputs `(("girara" ,girara)))
350 `(("djvulibre" ,djvulibre)
352 ("zathura" ,zathura)))
353 (build-system gnu-build-system)
355 `(#:make-flags (list (string-append "PREFIX=" %output)
356 (string-append "PLUGINDIR=" %output "/lib/zathura")
358 #:tests? #f ; Package does not contain tests.
360 (alist-delete 'configure %standard-phases)))
361 (home-page "https://pwmt.org/projects/zathura-djvu/")
362 (synopsis "DjVu support for zathura (DjVuLibre backend)")
363 (description "The zathura-djvu plugin adds DjVu support to zathura
364 using the DjVuLibre library.")
365 (license license:zlib)))
367 (define-public zathura-pdf-poppler
369 (name "zathura-pdf-poppler")
374 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
378 "1h43sgxpsbrsnn5z19661642plzhpv6b0y3f4kyzshv1rr6lwplq"))))
379 (native-inputs `(("pkg-config" ,pkg-config)))
380 (propagated-inputs `(("girara" ,girara)))
382 `(("poppler" ,poppler)
386 (build-system gnu-build-system)
388 `(#:make-flags (list (string-append "PREFIX=" %output)
389 (string-append "PLUGINDIR=" %output "/lib/zathura")
391 #:tests? #f ; Package does not include tests.
393 (alist-delete 'configure %standard-phases)))
394 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
395 (synopsis "PDF support for zathura (poppler backend)")
396 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
397 by using the poppler rendering engine.")
398 (license license:zlib)))
400 (define-public zathura
407 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
411 "1w0g74dq4z2vl3f99s2gkaqrb5pskgzig10qhbxj4gq9yj4zzbr2"))
412 (patches (search-patches
413 "zathura-plugindir-environment-variable.patch"))))
414 (native-inputs `(("pkg-config" ,pkg-config)
415 ("gettext" ,gettext-minimal)))
416 (inputs `(("girara" ,girara)
420 (list (search-path-specification
421 (variable "ZATHURA_PLUGIN_PATH")
422 (files '("lib/zathura")))))
423 (build-system gnu-build-system)
426 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
428 #:tests? #f ; Tests fail: "Gtk cannot open display".
431 (alist-delete 'configure %standard-phases)))
432 (home-page "https://pwmt.org/projects/zathura/")
433 (synopsis "Lightweight keyboard-driven PDF viewer")
434 (description "Zathura is a customizable document viewer. It provides a
435 minimalistic interface and an interface that mainly focuses on keyboard
437 (license license:zlib)))
439 (define-public podofo
445 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
446 "/podofo-" version ".tar.gz"))
449 "012kgfx5j5n6w4zkc1d290d2cwjk60jhzsjlr2x19g3yi75q2jc5"))))
450 (build-system cmake-build-system)
451 (inputs ; TODO: Add cppunit for tests
455 ("fontconfig" ,fontconfig)
457 ("libjpeg" ,libjpeg-8)
458 ("freetype" ,freetype)
461 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
462 "-DPODOFO_BUILD_STATIC=ON")
466 (lambda* (#:key inputs #:allow-other-keys)
467 (let ((freetype (assoc-ref inputs "freetype")))
468 ;; Look for freetype include files in the correct place.
469 (substitute* "cmake/modules/FindFREETYPE.cmake"
470 (("/usr/local") freetype))))
472 (home-page "http://podofo.sourceforge.net")
473 (synopsis "Tools to work with the PDF file format")
475 "PoDoFo is a C++ library and set of command-line tools to work with the
476 PDF file format. It can parse PDF files and load them into memory, and makes
477 it easy to modify them and write the changes to disk. It is primarily useful
478 for applications that wish to do lower level manipulation of PDF, such as
479 extracting content or merging files.")
480 (license license:lgpl2.0+)))
485 (replacement mupdf/fixed)
490 (uri (string-append "http://mupdf.com/downloads/archive/"
491 name "-" version "-source.tar.gz"))
494 "0dm8wcs8i29aibzkqkrn8kcnk4q0kd1v66pg48h5c3qqp4v1zk5a"))
495 (patches (search-patches "mupdf-build-with-openjpeg-2.1.patch"))
496 (modules '((guix build utils)))
498 ;; Delete all the bundled libraries except for mujs, which is
499 ;; developed by the same team as mupdf and has no releases.
500 ;; TODO Package mujs and don't use the bundled copy.
501 '(for-each delete-file-recursively
503 "thirdparty/freetype"
505 "thirdparty/harfbuzz"
506 "thirdparty/jbig2dec"
508 "thirdparty/openjpeg"
509 "thirdparty/zlib")))))
510 (build-system gnu-build-system)
513 ("freetype" ,freetype)
514 ("harfbuzz" ,harfbuzz)
515 ("jbig2dec" ,jbig2dec)
519 ("openjpeg" ,openjpeg)
523 `(("pkg-config" ,pkg-config)))
525 '(#:tests? #f ; no check target
526 #:make-flags (list "CC=gcc"
528 (string-append "prefix=" (assoc-ref %outputs "out")))
529 #:phases (modify-phases %standard-phases
530 (delete 'configure))))
531 (home-page "http://mupdf.com")
532 (synopsis "Lightweight PDF viewer and toolkit")
534 "MuPDF is a C library that implements a PDF and XPS parsing and
535 rendering engine. It is used primarily to render pages into bitmaps,
536 but also provides support for other operations such as searching and
537 listing the table of contents and hyperlinks.
539 The library ships with a rudimentary X11 viewer, and a set of command
540 line tools for batch rendering (pdfdraw), rewriting files (pdfclean),
541 and examining the file structure (pdfshow).")
542 (license license:agpl3+)))
549 (inherit (package-source mupdf))
552 (origin-patches (package-source mupdf))
553 (search-patches "mupdf-mujs-CVE-2016-10132.patch"
554 "mupdf-mujs-CVE-2016-10133.patch"
555 "mupdf-CVE-2017-5896.patch"
556 "mupdf-CVE-2017-5991.patch")))))))
564 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
565 "/qpdf-" version ".tar.gz"))
568 "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9"))
569 (modules '((guix build utils)))
571 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
572 ;; dependency on Perl.
573 '(substitute* "qpdf/fix-qdf"
574 (("#!/usr/bin/env perl")
576 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
577 & eval 'exec perl -wS \"$0\" $argv:q'
579 (build-system gnu-build-system)
581 `(#:disallowed-references (,perl)
583 (modify-phases %standard-phases
584 (add-before 'configure 'patch-paths
586 (substitute* "make/libtool.mk"
588 (string-append "SHELL=" (which "bash"))))
590 '("qtest/bin/qtest-driver")
591 (find-files "." "\\.test"))
592 (("/usr/bin/env") (which "env"))))))))
594 `(("pkg-config" ,pkg-config)
600 (synopsis "Command-line tools and library for transforming PDF files")
602 "QPDF is a command-line program that does structural, content-preserving
603 transformations on PDF files. It could have been called something like
604 pdf-to-pdf. It includes support for merging and splitting PDFs and to
605 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
606 program capable of converting PDF into other formats.")
607 (license license:clarified-artistic)
608 (home-page "http://qpdf.sourceforge.net/")))
610 (define-public xournal
617 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
618 "/xournal-" version ".tar.gz"))
621 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
622 (build-system gnu-build-system)
628 ("libgnomecanvas" ,libgnomecanvas)))
630 `(("pkg-config" ,pkg-config)))
631 (home-page "http://xournal.sourceforge.net/")
632 (synopsis "Notetaking using a stylus")
634 "Xournal is an application for notetaking, sketching, keeping a journal
636 (license license:gpl2+)))
638 (define-public python-reportlab
640 (name "python-reportlab")
644 (uri (pypi-uri "reportlab" version))
647 "0rz2pg04wnzjjm2f5a8ik9v8s54mv4xrjhv5liqjijqv6awh12gl"))))
648 (build-system python-build-system)
650 '(;; FIXME: There is one test failure, but it does not cause the
651 ;; build to fail. No time to investigate right now.
652 #:test-target "tests"))
654 `(("python-pillow" ,python-pillow)))
655 (home-page "http://www.reportlab.com")
656 (synopsis "Python library for generating PDFs and graphics")
657 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
658 of rich PDF documents, and also creation of charts in a variety of bitmap and
660 (license license:bsd-3)))
662 (define-public python2-reportlab
663 (package-with-python2 python-reportlab))
665 (define-public impressive
672 "mirror://sourceforge/impressive/Impressive/"
673 version "/Impressive-" version ".tar.gz"))
676 "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr"))))
677 (build-system python-build-system)
679 ;; TODO: Add dependency on pdftk.
680 (inputs `(("python-pygame" ,python-pygame)
681 ("python2-pillow" ,python2-pillow)
687 #:phases (modify-phases %standard-phases
692 (lambda* (#:key inputs outputs #:allow-other-keys)
693 ;; There's no 'setup.py' so install things manually.
694 (let* ((out (assoc-ref outputs "out"))
695 (bin (string-append out "/bin"))
696 (man1 (string-append out "/share/man/man1"))
697 (sdl (assoc-ref inputs "sdl"))
698 (xpdf (assoc-ref inputs "xpdf")))
700 (copy-file "impressive.py"
701 (string-append bin "/impressive"))
702 (wrap-program (string-append bin "/impressive")
703 `("LIBRARY_PATH" ":" prefix ;for ctypes
704 (,(string-append sdl "/lib")))
705 `("PATH" ":" prefix ;for pdftoppm
706 (,(string-append xpdf "/bin"))))
707 (install-file "impressive.1" man1)
709 (home-page "http://impressive.sourceforge.net")
710 (synopsis "PDF presentation tool with visual effects")
712 "Impressive is a tool to display PDF files that provides visual effects
713 such as smooth alpha-blended slide transitions. It provides additional tools
714 such as zooming, highlighting an area of the screen, and a tool to navigate
716 (license license:gpl2)))
722 (home-page "https://www.kraxel.org/blog/linux/fbida/")
725 (uri (string-append "https://www.kraxel.org/releases/fbida/"
726 name "-" version ".tar.gz"))
729 "0bw224vb7jh0lrqaf4jgxk48xglvxs674qcpj5y0axyfbh896cfk"))))
730 (build-system gnu-build-system)
732 '(#:phases (alist-cons-after
733 'unpack 'patch-ldconfig
735 (substitute* "mk/Autoconf.mk"
736 (("/sbin/ldconfig -p") "echo lib")) #t)
737 (alist-delete 'configure %standard-phases))
739 #:make-flags (list "CC=gcc"
740 (string-append "prefix=" (assoc-ref %outputs "out")))))
741 (inputs `(("libjpeg" ,libjpeg)
747 ("imagemagick" ,imagemagick)
750 ("cairo-xcb" ,cairo-xcb)
751 ("freetype" ,freetype)
752 ("fontconfig" ,fontconfig)
755 ("libepoxy" ,libepoxy)
757 ("poppler" ,poppler)))
758 (native-inputs `(("pkg-config" ,pkg-config)))
759 (synopsis "Framebuffer and drm-based image viewer")
761 "fbida contains a few applications for viewing and editing images on
764 (license license:gpl2+)))
766 (define-public pdf2svg
773 "https://github.com/dawbarton/pdf2svg/archive/v"
775 (file-name (string-append name "-" version ".tar.gz"))
778 "12pa1pajirnlrkz2il3h4l30lc2prryk1qr132jk6z9y1c3qdcag"))))
779 (build-system gnu-build-system)
782 ("poppler" ,poppler)))
784 `(("pkg-config" ,pkg-config)))
785 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
786 (synopsis "PDF to SVG converter")
787 (description "@command{pdf2svg} is a simple command-line PDF to SVG
788 converter using the Poppler and Cairo libraries.")
789 (license license:gpl2+)))
791 (define-public python-pypdf2
793 (name "python-pypdf2")
797 (uri (pypi-uri "PyPDF2" version))
800 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
801 (build-system python-build-system)
804 (modify-phases %standard-phases
806 'unpack 'patch-test-suite
808 ;; The text-file needs to be opened in binary mode for Python 3,
809 ;; so patch in the "b"
810 (substitute* "Tests/tests.py"
811 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
812 (string-append line "b")))
816 (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))
817 (home-page "http://mstamy2.github.com/PyPDF2")
818 (synopsis "Pure Python PDF toolkit")
819 (description "PyPDF2 is a pure Python PDF library capable of:
822 @item extracting document information (title, author, …)
823 @item splitting documents page by page
824 @item merging documents page by page
826 @item merging multiple pages into a single page
827 @item encrypting and decrypting PDF files
830 By being pure Python, it should run on any Python platform without any
831 dependencies on external libraries. It can also work entirely on
832 @code{StringIO} objects rather than file streams, allowing for PDF
833 manipulation in memory. It is therefore a useful tool for websites that
834 manage or manipulate PDFs.")
835 (license license:bsd-3)))
837 (define-public python2-pypdf2
838 (package-with-python2 python-pypdf2))
840 (define-public python2-pypdf
842 (name "python2-pypdf")
846 (uri (pypi-uri "pyPdf" version))
849 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
850 (build-system python-build-system)
852 `(#:tests? #f ; no tests
854 (home-page "http://pybrary.net/pyPdf/")
855 (synopsis "Pure Python PDF toolkit")
856 (description "PyPDF2 is a pure Python PDF toolkit.
858 Note: This module isn't maintained anymore. For new projects please use
859 python-pypdf2 instead.")
860 (license license:bsd-3)))
862 (define-public pdfposter
868 (uri (pypi-uri "pdftools.pdfposter" version ".tar.bz2"))
871 "1i9jqawf279va089ykicglcq4zlsnwgcnsdzaa8vnm836lqhywma"))))
872 (build-system python-build-system)
874 `(#:tests? #f ; no test suite, only for visual control
877 ;; pdfposter 0.6.0 still uses the old pyPdf
878 `(("python2-pypdf" ,python2-pypdf)))
879 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
880 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
881 (description "@command{pdfposter} can be used to create a large poster by
882 building it from multple pages and/or printing it on large media. It expects
883 as input a PDF file, normally printing on a single page. The output is again
884 a PDF file, maybe containing multiple pages together building the poster. The
885 input page will be scaled to obtain the desired size.
887 This is much like @command{poster} does for Postscript files, but working with
888 PDF. Since sometimes @command{poster} does not like your files converted from
889 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
890 (license license:gpl3+)))