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 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>
14 ;;; This file is part of GNU Guix.
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages pdf)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix utils)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system python)
37 #:use-module (guix build-system trivial)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages bash)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages fontutils)
44 #:use-module (gnu packages game-development)
45 #:use-module (gnu packages ghostscript)
46 #:use-module (gnu packages databases)
47 #:use-module (gnu packages djvu)
48 #:use-module (gnu packages gettext)
49 #:use-module (gnu packages backup)
50 #:use-module (gnu packages lesstif)
51 #:use-module (gnu packages linux)
52 #:use-module (gnu packages xdisorg)
53 #:use-module (gnu packages imagemagick)
54 #:use-module (gnu packages gl)
55 #:use-module (gnu packages photo)
56 #:use-module (gnu packages image)
57 #:use-module (gnu packages pkg-config)
58 #:use-module (gnu packages qt)
59 #:use-module (gnu packages xorg)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages lua)
64 #:use-module (gnu packages curl)
65 #:use-module (gnu packages pcre)
66 #:use-module (gnu packages perl)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages sdl)
69 #:use-module (gnu packages tls)
70 #:use-module (srfi srfi-1))
72 (define-public poppler
78 (uri (string-append "https://poppler.freedesktop.org/poppler-"
82 "0hnjkcqqk87dw3hlda4gh4l7brkslniax9a79g772jn3iwiffwmq"))))
83 (build-system gnu-build-system)
86 (inputs `(("fontconfig" ,fontconfig)
87 ("freetype" ,freetype)
92 ("openjpeg-1" ,openjpeg-1)
95 ;; To build poppler-glib (as needed by Evince), we need Cairo and
96 ;; GLib. But of course, that Cairo must not depend on Poppler.
97 ("cairo" ,(package (inherit cairo)
98 (inputs (alist-delete "poppler"
99 (package-inputs cairo)))))
102 `(("pkg-config" ,pkg-config)
103 ("glib" ,glib "bin") ; glib-mkenums, etc.
104 ("gobject-introspection" ,gobject-introspection)))
106 `(#:tests? #f ; no test data provided with the tarball
108 '("--enable-xpdf-headers" ; to install header files
111 ;; Saves 8 MiB of .a files.
114 (modify-phases %standard-phases
115 (add-before 'configure 'setenv
118 (string-append (assoc-ref %build-inputs "openjpeg-1")
119 "/include/openjpeg-1.5"
120 ":" (or (getenv "CPATH") ""))))))))
121 (synopsis "PDF rendering library")
123 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
124 (license license:gpl2+)
125 (home-page "https://poppler.freedesktop.org/")))
127 (define-public poppler-qt4
128 (package (inherit poppler)
130 (inputs `(("qt-4" ,qt-4)
131 ,@(package-inputs poppler)))
132 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
134 (define-public poppler-qt5
135 (package (inherit poppler)
137 (inputs `(("qtbase" ,qtbase)
138 ,@(package-inputs poppler)))
140 (substitute-keyword-arguments (package-arguments poppler)
141 ((#:configure-flags flags)
142 `(cons "CXXFLAGS=-std=gnu++11" ,flags))))
143 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
145 (define-public python-poppler-qt4
147 (name "python-poppler-qt4")
152 (uri (string-append "https://pypi.python.org/packages/source/p"
153 "/python-poppler-qt4/python-poppler-qt4-"
157 "0x63niylkk4q3h3ay8zrk3m1xiik0x3hlr4gvj7kswx48qi1vb99"))))
158 (build-system python-build-system)
161 (modify-phases %standard-phases
163 'unpack 'patch-poppler-include-paths
165 (substitute* (find-files "." "poppler-.*\\.sip")
166 (("qt4/poppler-.*\\.h" header)
167 (string-append "poppler/" header)))
170 `(("pkg-config" ,pkg-config)))
172 `(("python-sip" ,python-sip)
173 ("python-pyqt-4" ,python-pyqt-4)
174 ("poppler-qt4" ,poppler-qt4)))
175 (home-page "https://pypi.python.org/pypi/python-poppler-qt4")
176 (synopsis "Python bindings for Poppler-Qt4")
178 "This package provides Python bindings for the Qt4 interface of the
179 Poppler PDF rendering library.")
180 (license license:lgpl2.1+)))
182 (define-public libharu
188 (uri (string-append "https://github.com/libharu/libharu/archive/"
190 (string-join (string-split version #\.) "_")
192 (file-name (string-append name "-" version ".tar.gz"))
195 "1lm4v539y9cb1lvbq387j57sy7yxda3yv8b1pk8m6zazbp66i7lg"))))
196 (build-system gnu-build-system)
199 (list (string-append "--with-zlib="
200 (assoc-ref %build-inputs "zlib"))
201 (string-append "--with-png="
202 (assoc-ref %build-inputs "libpng")))
204 (modify-phases %standard-phases
205 (add-before 'configure 'autogen
206 (lambda _ (zero? (system* "autoreconf" "-vif")))))))
211 `(("autoconf" ,autoconf)
212 ("automake" ,automake)
213 ("libtool" ,libtool)))
214 (home-page "http://libharu.org/")
215 (synopsis "Library for generating PDF files")
217 "libHaru is a library for generating PDF files. libHaru does not support
218 reading and editing of existing PDF files.")
219 (license license:zlib)))
227 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
230 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
231 (build-system gnu-build-system)
232 (inputs `(("freetype" ,freetype)
233 ("gs-fonts" ,gs-fonts)
235 ("libpaper" ,libpaper)
244 `(#:tests? #f ; there is no check target
245 #:parallel-build? #f ; build fails randomly on 8-way machines
247 (list (string-append "--with-freetype2-includes="
248 (assoc-ref %build-inputs "freetype")
249 "/include/freetype2"))
253 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
254 (let* ((install (assoc-ref %standard-phases 'install))
255 (out (assoc-ref outputs "out"))
256 (xpdfrc (string-append out "/etc/xpdfrc"))
257 (gs-fonts (assoc-ref inputs "gs-fonts")))
260 (("/usr/local/share/ghostscript/fonts")
261 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
262 (("#fontFile") "fontFile"))))
264 (synopsis "Viewer for PDF files based on the Motif toolkit")
266 "Xpdf is a viewer for Portable Document Format (PDF) files.")
267 (license license:gpl3) ; or gpl2, but not gpl2+
268 (home-page "http://www.foolabs.com/xpdf/")))
270 (define-public zathura-cb
277 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
281 "1zbazysdjwwnzw01qlnzyixwmsi8rqskc76mp81qcr3rpl96jprp"))))
282 (native-inputs `(("pkg-config" ,pkg-config)))
283 (propagated-inputs `(("girara" ,girara)))
284 (inputs `(("libarchive" ,libarchive)
286 ("zathura" ,zathura)))
287 (build-system gnu-build-system)
289 `(#:make-flags (list (string-append "PREFIX=" %output)
290 (string-append "PLUGINDIR=" %output "/lib/zathura")
292 #:tests? #f ; Package does not contain tests.
294 (alist-delete 'configure %standard-phases)))
295 (home-page "https://pwmt.org/projects/zathura-cb/")
296 (synopsis "Comic book support for zathura (libarchive backend)")
297 (description "The zathura-cb plugin adds comic book support to zathura
299 (license license:zlib)))
301 (define-public zathura-ps
308 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
312 "18wsfy8pqficdgj8wy2aws7j4fy8z78157rhqk17mj5f295zgvm9"))))
313 (native-inputs `(("pkg-config" ,pkg-config)))
314 (propagated-inputs `(("girara" ,girara)))
315 (inputs `(("libspectre" ,libspectre)
317 ("zathura" ,zathura)))
318 (build-system gnu-build-system)
320 `(#:make-flags (list (string-append "PREFIX=" %output)
321 (string-append "PLUGINDIR=" %output "/lib/zathura")
323 #:tests? #f ; Package does not contain tests.
325 (alist-delete 'configure %standard-phases)))
326 (home-page "https://pwmt.org/projects/zathura-ps/")
327 (synopsis "PS support for zathura (libspectre backend)")
328 (description "The zathura-ps plugin adds PS support to zathura
330 (license license:zlib)))
332 (define-public zathura-djvu
334 (name "zathura-djvu")
339 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
343 "03cw54d2fipvbrnbqy0xccqkx6s77dyhyymx479aj5ryy4513dq8"))))
344 (native-inputs `(("pkg-config" ,pkg-config)))
345 (propagated-inputs `(("girara" ,girara)))
347 `(("djvulibre" ,djvulibre)
349 ("zathura" ,zathura)))
350 (build-system gnu-build-system)
352 `(#:make-flags (list (string-append "PREFIX=" %output)
353 (string-append "PLUGINDIR=" %output "/lib/zathura")
355 #:tests? #f ; Package does not contain tests.
357 (alist-delete 'configure %standard-phases)))
358 (home-page "https://pwmt.org/projects/zathura-djvu/")
359 (synopsis "DjVu support for zathura (DjVuLibre backend)")
360 (description "The zathura-djvu plugin adds DjVu support to zathura
361 using the DjVuLibre library.")
362 (license license:zlib)))
364 (define-public zathura-pdf-poppler
366 (name "zathura-pdf-poppler")
371 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
375 "1maqiv7yv8d8hymlffa688c5z71v85kbzmx2j88i8z349xx0rsyi"))))
376 (native-inputs `(("pkg-config" ,pkg-config)))
377 (propagated-inputs `(("girara" ,girara)))
379 `(("poppler" ,poppler)
383 (build-system gnu-build-system)
385 `(#:make-flags (list (string-append "PREFIX=" %output)
386 (string-append "PLUGINDIR=" %output "/lib/zathura")
388 #:tests? #f ; Package does not include tests.
390 (alist-delete 'configure %standard-phases)))
391 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
392 (synopsis "PDF support for zathura (poppler backend)")
393 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
394 by using the poppler rendering engine.")
395 (license license:zlib)))
397 (define-public zathura
404 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
408 "0fyb5hak0knqvg90rmdavwcmilhnrwgg1s5ykx9wd3skbpi8nsh8"))
409 (patches (search-patches
410 "zathura-plugindir-environment-variable.patch"))))
411 (native-inputs `(("pkg-config" ,pkg-config)
412 ("gettext" ,gettext-minimal)))
413 (inputs `(("girara" ,girara)
417 (list (search-path-specification
418 (variable "ZATHURA_PLUGIN_PATH")
419 (files '("lib/zathura")))))
420 (build-system gnu-build-system)
423 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
425 #:tests? #f ; Tests fail: "Gtk cannot open display".
428 (alist-delete 'configure %standard-phases)))
429 (home-page "https://pwmt.org/projects/zathura/")
430 (synopsis "Lightweight keyboard-driven PDF viewer")
431 (description "Zathura is a customizable document viewer. It provides a
432 minimalistic interface and an interface that mainly focuses on keyboard
434 (license license:zlib)))
436 (define-public podofo
442 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
443 "/podofo-" version ".tar.gz"))
446 "1n12lbq9x15vqn7dc0hsccp56l5jdff1xrhvlfqlbklxx0qiw9pc"))))
447 (build-system cmake-build-system)
448 (inputs ; TODO: Add cppunit for tests
452 ("fontconfig" ,fontconfig)
454 ("libjpeg" ,libjpeg-8)
455 ("freetype" ,freetype)
458 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
459 "-DPODOFO_BUILD_STATIC=ON")
463 (lambda* (#:key inputs #:allow-other-keys)
464 (let ((freetype (assoc-ref inputs "freetype")))
465 ;; Look for freetype include files in the correct place.
466 (substitute* "cmake/modules/FindFREETYPE.cmake"
467 (("/usr/local") freetype))))
469 (home-page "http://podofo.sourceforge.net")
470 (synopsis "Tools to work with the PDF file format")
472 "PoDoFo is a C++ library and set of command-line tools to work with the
473 PDF file format. It can parse PDF files and load them into memory, and makes
474 it easy to modify them and write the changes to disk. It is primarily useful
475 for applications that wish to do lower level manipulation of PDF, such as
476 extracting content or merging files.")
477 (license license:lgpl2.0+)))
486 (uri (string-append "http://mupdf.com/downloads/archive/"
487 name "-" version "-source.tar.gz"))
490 "1k64pdapyj8a336jw3j61fhn0rp4q6az7d0dqp9r5n3d9rgwa5c0"))
491 (patches (search-patches "mupdf-build-with-openjpeg-2.1.patch"
492 "mupdf-CVE-2016-6265.patch"
493 "mupdf-CVE-2016-6525.patch"
494 "mupdf-CVE-2016-7504.patch"
495 "mupdf-CVE-2016-7505.patch"
496 "mupdf-CVE-2016-7506.patch"
497 "mupdf-CVE-2016-7563.patch"
498 "mupdf-CVE-2016-7564.patch"
499 "mupdf-CVE-2016-8674.patch"
500 "mupdf-CVE-2016-9017.patch"
501 "mupdf-CVE-2016-9136.patch"))
502 (modules '((guix build utils)))
504 ;; Delete all the bundled libraries except for mujs, which is
505 ;; developed by the same team as mupdf and has no releases.
506 ;; TODO Package mujs and don't use the bundled copy.
507 '(for-each delete-file-recursively
509 "thirdparty/freetype"
511 "thirdparty/harfbuzz"
512 "thirdparty/jbig2dec"
514 "thirdparty/openjpeg"
515 "thirdparty/zlib")))))
516 (build-system gnu-build-system)
519 ("freetype" ,freetype)
520 ("harfbuzz" ,harfbuzz)
521 ("jbig2dec" ,jbig2dec)
525 ("openjpeg" ,openjpeg)
529 `(("pkg-config" ,pkg-config)))
531 '(#:tests? #f ; no check target
532 #:make-flags (list "CC=gcc"
534 (string-append "prefix=" (assoc-ref %outputs "out")))
535 #:phases (modify-phases %standard-phases
536 (delete 'configure))))
537 (home-page "http://mupdf.com")
538 (synopsis "Lightweight PDF viewer and toolkit")
540 "MuPDF is a C library that implements a PDF and XPS parsing and
541 rendering engine. It is used primarily to render pages into bitmaps,
542 but also provides support for other operations such as searching and
543 listing the table of contents and hyperlinks.
545 The library ships with a rudimentary X11 viewer, and a set of command
546 line tools for batch rendering (pdfdraw), rewriting files (pdfclean),
547 and examining the file structure (pdfshow).")
548 (license license:agpl3+)))
556 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
557 "/qpdf-" version ".tar.gz"))
560 "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9"))
561 (modules '((guix build utils)))
563 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
564 ;; dependency on Perl.
565 '(substitute* "qpdf/fix-qdf"
566 (("#!/usr/bin/env perl")
568 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
569 & eval 'exec perl -wS \"$0\" $argv:q'
571 (build-system gnu-build-system)
573 `(#:disallowed-references (,perl)
575 (modify-phases %standard-phases
576 (add-before 'configure 'patch-paths
578 (substitute* "make/libtool.mk"
580 (string-append "SHELL=" (which "bash"))))
582 '("qtest/bin/qtest-driver")
583 (find-files "." "\\.test"))
584 (("/usr/bin/env") (which "env"))))))))
586 `(("pkg-config" ,pkg-config)
592 (synopsis "Command-line tools and library for transforming PDF files")
594 "QPDF is a command-line program that does structural, content-preserving
595 transformations on PDF files. It could have been called something like
596 pdf-to-pdf. It includes support for merging and splitting PDFs and to
597 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
598 program capable of converting PDF into other formats.")
599 (license license:clarified-artistic)
600 (home-page "http://qpdf.sourceforge.net/")))
602 (define-public xournal
609 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
610 "/xournal-" version ".tar.gz"))
613 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
614 (build-system gnu-build-system)
620 ("libgnomecanvas" ,libgnomecanvas)))
622 `(("pkg-config" ,pkg-config)))
623 (home-page "http://xournal.sourceforge.net/")
624 (synopsis "Notetaking using a stylus")
626 "Xournal is an application for notetaking, sketching, keeping a journal
628 (license license:gpl2+)))
630 (define-public python-reportlab
632 (name "python-reportlab")
636 (uri (pypi-uri "reportlab" version))
639 "0rz2pg04wnzjjm2f5a8ik9v8s54mv4xrjhv5liqjijqv6awh12gl"))))
640 (build-system python-build-system)
642 `(("python-pillow" ,python-pillow)))
643 (home-page "http://www.reportlab.com")
644 (synopsis "Python library for generating PDFs and graphics")
645 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
646 of rich PDF documents, and also creation of charts in a variety of bitmap and
648 (license license:bsd-3)))
650 (define-public python2-reportlab
651 (package-with-python2 python-reportlab))
653 (define-public impressive
660 "mirror://sourceforge/impressive/Impressive/"
661 version "/Impressive-" version ".tar.gz"))
664 "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr"))))
665 (build-system python-build-system)
667 ;; TODO: Add dependency on pdftk.
668 (inputs `(("python-pygame" ,python-pygame)
669 ("python2-pillow" ,python2-pillow)
675 #:phases (modify-phases %standard-phases
680 (lambda* (#:key inputs outputs #:allow-other-keys)
681 ;; There's no 'setup.py' so install things manually.
682 (let* ((out (assoc-ref outputs "out"))
683 (bin (string-append out "/bin"))
684 (man1 (string-append out "/share/man/man1"))
685 (sdl (assoc-ref inputs "sdl"))
686 (xpdf (assoc-ref inputs "xpdf")))
688 (copy-file "impressive.py"
689 (string-append bin "/impressive"))
690 (wrap-program (string-append bin "/impressive")
691 `("LIBRARY_PATH" ":" prefix ;for ctypes
692 (,(string-append sdl "/lib")))
693 `("PATH" ":" prefix ;for pdftoppm
694 (,(string-append xpdf "/bin"))))
696 (install-file "impressive.1" man1)
698 (home-page "http://impressive.sourceforge.net")
699 (synopsis "PDF presentation tool with visual effects")
701 "Impressive is a tool to display PDF files that provides visual effects
702 such as smooth alpha-blended slide transitions. It provides additional tools
703 such as zooming, highlighting an area of the screen, and a tool to navigate
705 (license license:gpl2)))
711 (home-page "https://www.kraxel.org/blog/linux/fbida/")
714 (uri (string-append "https://www.kraxel.org/releases/fbida/"
715 name "-" version ".tar.gz"))
718 "0bw224vb7jh0lrqaf4jgxk48xglvxs674qcpj5y0axyfbh896cfk"))))
719 (build-system gnu-build-system)
721 '(#:phases (alist-cons-after
722 'unpack 'patch-ldconfig
724 (substitute* "mk/Autoconf.mk"
725 (("/sbin/ldconfig -p") "echo lib")) #t)
726 (alist-delete 'configure %standard-phases))
728 #:make-flags (list "CC=gcc"
729 (string-append "prefix=" (assoc-ref %outputs "out")))))
730 (inputs `(("libjpeg" ,libjpeg)
736 ("imagemagick" ,imagemagick)
739 ("cairo-xcb" ,cairo-xcb)
740 ("freetype" ,freetype)
741 ("fontconfig" ,fontconfig)
744 ("libepoxy" ,libepoxy)
746 ("poppler" ,poppler)))
747 (native-inputs `(("pkg-config" ,pkg-config)))
748 (synopsis "Framebuffer and drm-based image viewer")
750 "fbida contains a few applications for viewing and editing images on
753 (license license:gpl2+)))
755 (define-public pdf2svg
762 "https://github.com/dawbarton/pdf2svg/archive/v"
764 (file-name (string-append name "-" version ".tar.gz"))
767 "12pa1pajirnlrkz2il3h4l30lc2prryk1qr132jk6z9y1c3qdcag"))))
768 (build-system gnu-build-system)
771 ("poppler" ,poppler)))
773 `(("pkg-config" ,pkg-config)))
774 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
775 (synopsis "PDF to SVG converter")
776 (description "@command{pdf2svg} is a simple command-line PDF to SVG
777 converter using the Poppler and Cairo libraries.")
778 (license license:gpl2+)))
780 (define-public python-pypdf2
782 (name "python-pypdf2")
786 (uri (pypi-uri "PyPDF2" version))
789 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
790 (build-system python-build-system)
793 (modify-phases %standard-phases
795 'unpack 'patch-test-suite
797 ;; The text-file needs to be opened in binary mode for Python 3,
798 ;; so patch in the "b"
799 (substitute* "Tests/tests.py"
800 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
801 (string-append line "b")))
805 (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))
806 (home-page "http://mstamy2.github.com/PyPDF2")
807 (synopsis "Pure Python PDF toolkit")
808 (description "PyPDF2 is a pure Python PDF library capable of:
811 @item extracting document information (title, author, …)
812 @item splitting documents page by page
813 @item merging documents page by page
815 @item merging multiple pages into a single page
816 @item encrypting and decrypting PDF files
819 By being pure Python, it should run on any Python platform without any
820 dependencies on external libraries. It can also work entirely on
821 @code{StringIO} objects rather than file streams, allowing for PDF
822 manipulation in memory. It is therefore a useful tool for websites that
823 manage or manipulate PDFs.")
824 (license license:bsd-3)))
826 (define-public python2-pypdf2
827 (package-with-python2 python-pypdf2))
829 (define-public python2-pypdf
831 (name "python2-pypdf")
835 (uri (pypi-uri "pyPdf" version))
838 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
839 (build-system python-build-system)
841 `(#:tests? #f ; no tests
843 (home-page "http://pybrary.net/pyPdf/")
844 (synopsis "Pure Python PDF toolkit")
845 (description "PyPDF2 is a pure Python PDF toolkit.
847 Note: This module isn't maintained anymore. For new projects please use
848 python-pypdf2 instead.")
849 (license license:bsd-3)))
851 (define-public pdfposter
857 (uri (pypi-uri "pdftools.pdfposter" version ".tar.bz2"))
860 "1i9jqawf279va089ykicglcq4zlsnwgcnsdzaa8vnm836lqhywma"))))
861 (build-system python-build-system)
863 `(#:tests? #f ; no test suite, only for visual control
866 ;; pdfposter 0.6.0 still uses the old pyPdf
867 `(("python2-pypdf" ,python2-pypdf)))
868 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
869 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
870 (description "@command{pdfposter} can be used to create a large poster by
871 building it from multple pages and/or printing it on large media. It expects
872 as input a PDF file, normally printing on a single page. The output is again
873 a PDF file, maybe containing multiple pages together building the poster. The
874 input page will be scaled to obtain the desired size.
876 This is much like @command{poster} does for Postscript files, but working with
877 PDF. Since sometimes @command{poster} does not like your files converted from
878 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
879 (license license:gpl3+)))