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>
15 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages pdf)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix utils)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system cmake)
39 #:use-module (guix build-system python)
40 #:use-module (guix build-system trivial)
41 #:use-module (gnu packages)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages bash)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages fontutils)
47 #:use-module (gnu packages game-development)
48 #:use-module (gnu packages ghostscript)
49 #:use-module (gnu packages gnupg)
50 #:use-module (gnu packages databases)
51 #:use-module (gnu packages djvu)
52 #:use-module (gnu packages gettext)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages lesstif)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages xdisorg)
57 #:use-module (gnu packages imagemagick)
58 #:use-module (gnu packages gl)
59 #:use-module (gnu packages photo)
60 #:use-module (gnu packages image)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages qt)
63 #:use-module (gnu packages xorg)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages glib)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages lua)
68 #:use-module (gnu packages curl)
69 #:use-module (gnu packages pcre)
70 #:use-module (gnu packages perl)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages sdl)
73 #:use-module (gnu packages tls)
74 #:use-module (srfi srfi-1))
76 (define-public poppler
79 (replacement poppler/fixed)
83 (uri (string-append "https://poppler.freedesktop.org/poppler-"
87 "14hrrac2f1phi5j0qn283457w06vsp9gr075yqjrm7w370bnd2sj"))))
88 (build-system gnu-build-system)
91 (inputs `(("fontconfig" ,fontconfig)
92 ("freetype" ,freetype)
97 ("openjpeg-1" ,openjpeg-1) ; prefers openjpeg-1
100 ;; To build poppler-glib (as needed by Evince), we need Cairo and
101 ;; GLib. But of course, that Cairo must not depend on Poppler.
102 ("cairo" ,(package (inherit cairo)
103 (inputs (alist-delete "poppler"
104 (package-inputs cairo)))))
107 `(("pkg-config" ,pkg-config)
108 ("glib" ,glib "bin") ; glib-mkenums, etc.
109 ("gobject-introspection" ,gobject-introspection)))
111 `(#:tests? #f ; no test data provided with the tarball
113 '("--enable-xpdf-headers" ; to install header files
116 ;; Saves 8 MiB of .a files.
119 (modify-phases %standard-phases
120 (add-before 'configure 'setenv
123 (string-append (assoc-ref %build-inputs "openjpeg-1")
124 "/include/openjpeg-1.5"
125 ":" (or (getenv "CPATH") "")))
127 (synopsis "PDF rendering library")
129 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
130 (license license:gpl2+)
131 (home-page "https://poppler.freedesktop.org/")))
133 (define poppler/fixed
134 (package (inherit poppler)
137 (inherit (package-source poppler))
138 (patches (search-patches "poppler-fix-crash-with-broken-documents.patch"
139 "poppler-CVE-2017-9776.patch"))))))
141 (define-public poppler-qt4
142 (package/inherit poppler
144 (inputs `(("qt-4" ,qt-4)
145 ,@(package-inputs poppler)))
146 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
148 (define-public poppler-qt5
149 (package/inherit poppler
151 (inputs `(("qtbase" ,qtbase)
152 ,@(package-inputs poppler)))
154 (substitute-keyword-arguments (package-arguments poppler)
155 ((#:configure-flags flags)
156 `(cons "CXXFLAGS=-std=gnu++11" ,flags))))
157 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
159 (define-public python-poppler-qt4
161 (name "python-poppler-qt4")
166 (uri (string-append "https://pypi.python.org/packages/source/p"
167 "/python-poppler-qt4/python-poppler-qt4-"
171 "0x63niylkk4q3h3ay8zrk3m1xiik0x3hlr4gvj7kswx48qi1vb99"))))
172 (build-system python-build-system)
175 (modify-phases %standard-phases
177 'unpack 'patch-poppler-include-paths
179 (substitute* (find-files "." "poppler-.*\\.sip")
180 (("qt4/poppler-.*\\.h" header)
181 (string-append "poppler/" header)))
184 `(("pkg-config" ,pkg-config)))
186 `(("python-sip" ,python-sip)
187 ("python-pyqt-4" ,python-pyqt-4)
188 ("poppler-qt4" ,poppler-qt4)))
189 (home-page "https://pypi.python.org/pypi/python-poppler-qt4")
190 (synopsis "Python bindings for Poppler-Qt4")
192 "This package provides Python bindings for the Qt4 interface of the
193 Poppler PDF rendering library.")
194 (license license:lgpl2.1+)))
196 (define-public python-poppler-qt5
198 (name "python-poppler-qt5")
203 (uri (pypi-uri "python-poppler-qt5" version))
206 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
207 (build-system python-build-system)
209 `(;; There are no tests. The check phase just causes a rebuild.
212 (modify-phases %standard-phases
214 (lambda* (#:key inputs #:allow-other-keys)
215 (substitute* "setup.py"
216 ;; This check always fails, so disable it.
217 (("if not check_qtxml\\(\\)")
219 ;; Enable C++11, which is needed because of Qt5.
220 (("\\*\\*ext_args" line)
221 (string-append "extra_compile_args=['-std=gnu++11'], " line)))
222 ;; We need to pass an extra flag here. This cannot be in
223 ;; configure-flags because it should not be passed for the
224 ;; installation phase.
225 ((@@ (guix build python-build-system) call-setuppy)
226 "build_ext" (list (string-append "--pyqt-sip-dir="
227 (assoc-ref inputs "python-pyqt")
228 "/share/sip")) #t))))))
230 `(("pkg-config" ,pkg-config)))
232 `(("python-sip" ,python-sip)
233 ("python-pyqt" ,python-pyqt)
234 ("poppler-qt5" ,poppler-qt5)
236 (home-page "https://pypi.python.org/pypi/python-poppler-qt5")
237 (synopsis "Python bindings for Poppler-Qt5")
239 "This package provides Python bindings for the Qt5 interface of the
240 Poppler PDF rendering library.")
241 (license license:lgpl2.1+)))
243 (define-public libharu
249 (uri (string-append "https://github.com/libharu/libharu/archive/"
251 (string-join (string-split version #\.) "_")
253 (file-name (string-append name "-" version ".tar.gz"))
256 "1lm4v539y9cb1lvbq387j57sy7yxda3yv8b1pk8m6zazbp66i7lg"))))
257 (build-system gnu-build-system)
260 (list (string-append "--with-zlib="
261 (assoc-ref %build-inputs "zlib"))
262 (string-append "--with-png="
263 (assoc-ref %build-inputs "libpng")))
265 (modify-phases %standard-phases
266 (add-before 'configure 'autogen
267 (lambda _ (zero? (system* "autoreconf" "-vif")))))))
272 `(("autoconf" ,autoconf)
273 ("automake" ,automake)
274 ("libtool" ,libtool)))
275 (home-page "http://libharu.org/")
276 (synopsis "Library for generating PDF files")
278 "libHaru is a library for generating PDF files. libHaru does not support
279 reading and editing of existing PDF files.")
280 (license license:zlib)))
288 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
291 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
292 (build-system gnu-build-system)
293 (inputs `(("freetype" ,freetype)
294 ("gs-fonts" ,gs-fonts)
296 ("libpaper" ,libpaper)
305 `(#:tests? #f ; there is no check target
306 #:parallel-build? #f ; build fails randomly on 8-way machines
308 (list (string-append "--with-freetype2-includes="
309 (assoc-ref %build-inputs "freetype")
310 "/include/freetype2"))
314 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
315 (let* ((install (assoc-ref %standard-phases 'install))
316 (out (assoc-ref outputs "out"))
317 (xpdfrc (string-append out "/etc/xpdfrc"))
318 (gs-fonts (assoc-ref inputs "gs-fonts")))
321 (("/usr/local/share/ghostscript/fonts")
322 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
323 (("#fontFile") "fontFile"))))
325 (synopsis "Viewer for PDF files based on the Motif toolkit")
327 "Xpdf is a viewer for Portable Document Format (PDF) files.")
328 (license license:gpl3) ; or gpl2, but not gpl2+
329 (home-page "http://www.foolabs.com/xpdf/")))
331 (define-public zathura-cb
338 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
342 "1fim4mpm8l2g3msj1vg70ks3c9lrwllv3yh4jv8l9f8k3r19b3l8"))))
343 (native-inputs `(("pkg-config" ,pkg-config)))
344 (propagated-inputs `(("girara" ,girara)))
345 (inputs `(("libarchive" ,libarchive)
347 ("zathura" ,zathura)))
348 (build-system gnu-build-system)
350 `(#:make-flags (list (string-append "PREFIX=" %output)
351 (string-append "PLUGINDIR=" %output "/lib/zathura")
353 #:tests? #f ; Package does not contain tests.
355 (alist-delete 'configure %standard-phases)))
356 (home-page "https://pwmt.org/projects/zathura-cb/")
357 (synopsis "Comic book support for zathura (libarchive backend)")
358 (description "The zathura-cb plugin adds comic book support to zathura
360 (license license:zlib)))
362 (define-public zathura-ps
369 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
373 "1nxbl0glnzpan78fhdfzhkcd0cikcvrkzf9m56mb0pvnwzlwg7zv"))))
374 (native-inputs `(("pkg-config" ,pkg-config)))
375 (propagated-inputs `(("girara" ,girara)))
376 (inputs `(("libspectre" ,libspectre)
378 ("zathura" ,zathura)))
379 (build-system gnu-build-system)
381 `(#:make-flags (list (string-append "PREFIX=" %output)
382 (string-append "PLUGINDIR=" %output "/lib/zathura")
384 #:tests? #f ; Package does not contain tests.
386 (alist-delete 'configure %standard-phases)))
387 (home-page "https://pwmt.org/projects/zathura-ps/")
388 (synopsis "PS support for zathura (libspectre backend)")
389 (description "The zathura-ps plugin adds PS support to zathura
391 (license license:zlib)))
393 (define-public zathura-djvu
395 (name "zathura-djvu")
400 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
404 "0py0ra44f65cg064xzds0qr6vnglj2a5bwhnbwa0dyh2nyizdzmf"))))
405 (native-inputs `(("pkg-config" ,pkg-config)))
406 (propagated-inputs `(("girara" ,girara)))
408 `(("djvulibre" ,djvulibre)
410 ("zathura" ,zathura)))
411 (build-system gnu-build-system)
413 `(#:make-flags (list (string-append "PREFIX=" %output)
414 (string-append "PLUGINDIR=" %output "/lib/zathura")
416 #:tests? #f ; Package does not contain tests.
418 (alist-delete 'configure %standard-phases)))
419 (home-page "https://pwmt.org/projects/zathura-djvu/")
420 (synopsis "DjVu support for zathura (DjVuLibre backend)")
421 (description "The zathura-djvu plugin adds DjVu support to zathura
422 using the DjVuLibre library.")
423 (license license:zlib)))
425 (define-public zathura-pdf-poppler
427 (name "zathura-pdf-poppler")
432 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
436 "1h43sgxpsbrsnn5z19661642plzhpv6b0y3f4kyzshv1rr6lwplq"))))
437 (native-inputs `(("pkg-config" ,pkg-config)))
438 (propagated-inputs `(("girara" ,girara)))
440 `(("poppler" ,poppler)
444 (build-system gnu-build-system)
446 `(#:make-flags (list (string-append "PREFIX=" %output)
447 (string-append "PLUGINDIR=" %output "/lib/zathura")
449 #:tests? #f ; Package does not include tests.
451 (alist-delete 'configure %standard-phases)))
452 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
453 (synopsis "PDF support for zathura (poppler backend)")
454 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
455 by using the poppler rendering engine.")
456 (license license:zlib)))
458 (define-public zathura
465 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
469 "1w0g74dq4z2vl3f99s2gkaqrb5pskgzig10qhbxj4gq9yj4zzbr2"))
470 (patches (search-patches
471 "zathura-plugindir-environment-variable.patch"))))
472 (native-inputs `(("pkg-config" ,pkg-config)
473 ("gettext" ,gettext-minimal)))
474 (inputs `(("girara" ,girara)
478 (list (search-path-specification
479 (variable "ZATHURA_PLUGIN_PATH")
480 (files '("lib/zathura")))))
481 (build-system gnu-build-system)
484 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
486 #:tests? #f ; Tests fail: "Gtk cannot open display".
489 (alist-delete 'configure %standard-phases)))
490 (home-page "https://pwmt.org/projects/zathura/")
491 (synopsis "Lightweight keyboard-driven PDF viewer")
492 (description "Zathura is a customizable document viewer. It provides a
493 minimalistic interface and an interface that mainly focuses on keyboard
495 (license license:zlib)))
497 (define-public podofo
503 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
504 "/podofo-" version ".tar.gz"))
507 "012kgfx5j5n6w4zkc1d290d2cwjk60jhzsjlr2x19g3yi75q2jc5"))))
508 (build-system cmake-build-system)
509 (inputs ; TODO: Add cppunit for tests
513 ("fontconfig" ,fontconfig)
515 ("libjpeg" ,libjpeg-8)
516 ("freetype" ,freetype)
519 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
520 "-DPODOFO_BUILD_STATIC=ON")
524 (lambda* (#:key inputs #:allow-other-keys)
525 (let ((freetype (assoc-ref inputs "freetype")))
526 ;; Look for freetype include files in the correct place.
527 (substitute* "cmake/modules/FindFREETYPE.cmake"
528 (("/usr/local") freetype))))
530 (home-page "http://podofo.sourceforge.net")
531 (synopsis "Tools to work with the PDF file format")
533 "PoDoFo is a C++ library and set of command-line tools to work with the
534 PDF file format. It can parse PDF files and load them into memory, and makes
535 it easy to modify them and write the changes to disk. It is primarily useful
536 for applications that wish to do lower level manipulation of PDF, such as
537 extracting content or merging files.")
538 (license license:lgpl2.0+)))
547 (uri (string-append "http://mupdf.com/downloads/archive/"
548 name "-" version "-source.tar.gz"))
551 "02phamcchgsmvjnb3ir7r5sssvx9fcrscn297z73b82n1jl79510"))
552 (patches (search-patches "mupdf-build-with-openjpeg-2.1.patch"))
553 (modules '((guix build utils)))
555 ;; Delete all the bundled libraries except for mujs, which is
556 ;; developed by the same team as mupdf and has no releases.
557 ;; TODO Package mujs and don't use the bundled copy.
558 '(for-each delete-file-recursively
560 "thirdparty/freetype"
562 "thirdparty/harfbuzz"
563 "thirdparty/jbig2dec"
565 "thirdparty/openjpeg"
566 "thirdparty/zlib")))))
567 (build-system gnu-build-system)
570 ("freetype" ,freetype)
571 ("harfbuzz" ,harfbuzz)
572 ("jbig2dec" ,jbig2dec)
576 ("openjpeg" ,openjpeg)
580 `(("pkg-config" ,pkg-config)))
582 '(#:tests? #f ; no check target
583 #:make-flags (list "CC=gcc"
585 (string-append "prefix=" (assoc-ref %outputs "out")))
586 #:phases (modify-phases %standard-phases
587 (delete 'configure))))
588 (home-page "http://mupdf.com")
589 (synopsis "Lightweight PDF viewer and toolkit")
591 "MuPDF is a C library that implements a PDF and XPS parsing and
592 rendering engine. It is used primarily to render pages into bitmaps,
593 but also provides support for other operations such as searching and
594 listing the table of contents and hyperlinks.
596 The library ships with a rudimentary X11 viewer, and a set of command
597 line tools for batch rendering (pdfdraw), rewriting files (pdfclean),
598 and examining the file structure (pdfshow).")
599 (license license:agpl3+)))
607 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
608 "/qpdf-" version ".tar.gz"))
611 "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9"))
612 (modules '((guix build utils)))
614 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
615 ;; dependency on Perl.
616 '(substitute* "qpdf/fix-qdf"
617 (("#!/usr/bin/env perl")
619 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
620 & eval 'exec perl -wS \"$0\" $argv:q'
622 (build-system gnu-build-system)
624 `(#:disallowed-references (,perl)
626 (modify-phases %standard-phases
627 (add-before 'configure 'patch-paths
629 (substitute* "make/libtool.mk"
631 (string-append "SHELL=" (which "bash"))))
633 '("qtest/bin/qtest-driver")
634 (find-files "." "\\.test"))
635 (("/usr/bin/env") (which "env"))))))))
637 `(("pkg-config" ,pkg-config)
643 (synopsis "Command-line tools and library for transforming PDF files")
645 "QPDF is a command-line program that does structural, content-preserving
646 transformations on PDF files. It could have been called something like
647 pdf-to-pdf. It includes support for merging and splitting PDFs and to
648 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
649 program capable of converting PDF into other formats.")
650 (license license:clarified-artistic)
651 (home-page "http://qpdf.sourceforge.net/")))
653 (define-public xournal
660 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
661 "/xournal-" version ".tar.gz"))
664 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
665 (build-system gnu-build-system)
671 ("libgnomecanvas" ,libgnomecanvas)))
673 `(("pkg-config" ,pkg-config)))
674 (home-page "http://xournal.sourceforge.net/")
675 (synopsis "Notetaking using a stylus")
677 "Xournal is an application for notetaking, sketching, keeping a journal
679 (license license:gpl2+)))
681 (define-public python-reportlab
683 (name "python-reportlab")
687 (uri (pypi-uri "reportlab" version))
690 "0rz2pg04wnzjjm2f5a8ik9v8s54mv4xrjhv5liqjijqv6awh12gl"))))
691 (build-system python-build-system)
693 '(;; FIXME: There is one test failure, but it does not cause the
694 ;; build to fail. No time to investigate right now.
695 #:test-target "tests"))
697 `(("python-pillow" ,python-pillow)))
698 (home-page "http://www.reportlab.com")
699 (synopsis "Python library for generating PDFs and graphics")
700 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
701 of rich PDF documents, and also creation of charts in a variety of bitmap and
703 (license license:bsd-3)))
705 (define-public python2-reportlab
706 (package-with-python2 python-reportlab))
708 (define-public impressive
715 "mirror://sourceforge/impressive/Impressive/"
716 version "/Impressive-" version ".tar.gz"))
719 "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr"))))
720 (build-system python-build-system)
722 ;; TODO: Add dependency on pdftk.
723 (inputs `(("python-pygame" ,python-pygame)
724 ("python2-pillow" ,python2-pillow)
730 #:phases (modify-phases %standard-phases
735 (lambda* (#:key inputs outputs #:allow-other-keys)
736 ;; There's no 'setup.py' so install things manually.
737 (let* ((out (assoc-ref outputs "out"))
738 (bin (string-append out "/bin"))
739 (man1 (string-append out "/share/man/man1"))
740 (sdl (assoc-ref inputs "sdl"))
741 (xpdf (assoc-ref inputs "xpdf")))
743 (copy-file "impressive.py"
744 (string-append bin "/impressive"))
745 (wrap-program (string-append bin "/impressive")
746 `("LIBRARY_PATH" ":" prefix ;for ctypes
747 (,(string-append sdl "/lib")))
748 `("PATH" ":" prefix ;for pdftoppm
749 (,(string-append xpdf "/bin"))))
750 (install-file "impressive.1" man1)
752 (home-page "http://impressive.sourceforge.net")
753 (synopsis "PDF presentation tool with visual effects")
755 "Impressive is a tool to display PDF files that provides visual effects
756 such as smooth alpha-blended slide transitions. It provides additional tools
757 such as zooming, highlighting an area of the screen, and a tool to navigate
759 (license license:gpl2)))
765 (home-page "https://www.kraxel.org/blog/linux/fbida/")
768 (uri (string-append "https://www.kraxel.org/releases/fbida/"
769 name "-" version ".tar.gz"))
772 "0bw224vb7jh0lrqaf4jgxk48xglvxs674qcpj5y0axyfbh896cfk"))))
773 (build-system gnu-build-system)
775 '(#:phases (alist-cons-after
776 'unpack 'patch-ldconfig
778 (substitute* "mk/Autoconf.mk"
779 (("/sbin/ldconfig -p") "echo lib")) #t)
780 (alist-delete 'configure %standard-phases))
782 #:make-flags (list "CC=gcc"
783 (string-append "prefix=" (assoc-ref %outputs "out")))))
784 (inputs `(("libjpeg" ,libjpeg)
790 ("imagemagick" ,imagemagick)
793 ("cairo-xcb" ,cairo-xcb)
794 ("freetype" ,freetype)
795 ("fontconfig" ,fontconfig)
798 ("libepoxy" ,libepoxy)
800 ("poppler" ,poppler)))
801 (native-inputs `(("pkg-config" ,pkg-config)))
802 (synopsis "Framebuffer and drm-based image viewer")
804 "fbida contains a few applications for viewing and editing images on
807 (license license:gpl2+)))
809 (define-public pdf2svg
816 "https://github.com/dawbarton/pdf2svg/archive/v"
818 (file-name (string-append name "-" version ".tar.gz"))
821 "12pa1pajirnlrkz2il3h4l30lc2prryk1qr132jk6z9y1c3qdcag"))))
822 (build-system gnu-build-system)
825 ("poppler" ,poppler)))
827 `(("pkg-config" ,pkg-config)))
828 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
829 (synopsis "PDF to SVG converter")
830 (description "@command{pdf2svg} is a simple command-line PDF to SVG
831 converter using the Poppler and Cairo libraries.")
832 (license license:gpl2+)))
834 (define-public python-pypdf2
836 (name "python-pypdf2")
840 (uri (pypi-uri "PyPDF2" version))
843 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
844 (build-system python-build-system)
847 (modify-phases %standard-phases
849 'unpack 'patch-test-suite
851 ;; The text-file needs to be opened in binary mode for Python 3,
852 ;; so patch in the "b"
853 (substitute* "Tests/tests.py"
854 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
855 (string-append line "b")))
859 (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))
860 (home-page "http://mstamy2.github.com/PyPDF2")
861 (synopsis "Pure Python PDF toolkit")
862 (description "PyPDF2 is a pure Python PDF library capable of:
865 @item extracting document information (title, author, …)
866 @item splitting documents page by page
867 @item merging documents page by page
869 @item merging multiple pages into a single page
870 @item encrypting and decrypting PDF files
873 By being pure Python, it should run on any Python platform without any
874 dependencies on external libraries. It can also work entirely on
875 @code{StringIO} objects rather than file streams, allowing for PDF
876 manipulation in memory. It is therefore a useful tool for websites that
877 manage or manipulate PDFs.")
878 (license license:bsd-3)))
880 (define-public python2-pypdf2
881 (package-with-python2 python-pypdf2))
883 (define-public python2-pypdf
885 (name "python2-pypdf")
889 (uri (pypi-uri "pyPdf" version))
892 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
893 (build-system python-build-system)
895 `(#:tests? #f ; no tests
897 (home-page "http://pybrary.net/pyPdf/")
898 (synopsis "Pure Python PDF toolkit")
899 (description "PyPDF2 is a pure Python PDF toolkit.
901 Note: This module isn't maintained anymore. For new projects please use
902 python-pypdf2 instead.")
903 (license license:bsd-3)))
905 (define-public pdfposter
911 (uri (pypi-uri "pdftools.pdfposter" version ".tar.bz2"))
914 "1i9jqawf279va089ykicglcq4zlsnwgcnsdzaa8vnm836lqhywma"))))
915 (build-system python-build-system)
917 `(#:tests? #f ; no test suite, only for visual control
920 ;; pdfposter 0.6.0 still uses the old pyPdf
921 `(("python2-pypdf" ,python2-pypdf)))
922 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
923 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
924 (description "@command{pdfposter} can be used to create a large poster by
925 building it from multple pages and/or printing it on large media. It expects
926 as input a PDF file, normally printing on a single page. The output is again
927 a PDF file, maybe containing multiple pages together building the poster. The
928 input page will be scaled to obtain the desired size.
930 This is much like @command{poster} does for Postscript files, but working with
931 PDF. Since sometimes @command{poster} does not like your files converted from
932 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
933 (license license:gpl3+)))
935 (define-public pdfgrep
942 (uri (string-append "https://pdfgrep.org/download/"
943 name "-" version ".tar.gz"))
946 "07llkrkcfjwd3ybai9ad10ybhr0biffcplmy7lw4fb87nd2dfw03"))))
947 (build-system gnu-build-system)
949 `(("pkg-config" ,pkg-config)))
951 `(("libgcrypt" ,libgcrypt)
953 ("poppler" ,poppler)))
954 (home-page "https://pdfgrep.org")
955 (synopsis "Command-line utility to search text in PDF files")
957 "Pdfgrep searches in pdf files for strings matching a regular expression.
958 Support some GNU grep options as file name output, page number output,
959 optional case insensitivity, count occurrences, color highlights and search in
961 (license license:gpl2+)))