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, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
6 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2016 ng0 <ng0@n0.is>
8 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
11 ;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
12 ;;; Copyright © 2016, 2019 Arun Isaac <arunisaac@systemreboot.net>
13 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
14 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
15 ;;; Copyright © 2017, 2018 Rene Saavedra <pacoon@protonmail.com>
16 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
17 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
18 ;;; Copyright © 2019 Ben Sturmfels <ben@sturm.com.au>
19 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages pdf)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix utils)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system cmake)
44 #:use-module (guix build-system meson)
45 #:use-module (guix build-system python)
46 #:use-module (guix build-system trivial)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages backup)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages bash)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages curl)
55 #:use-module (gnu packages djvu)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages game-development)
58 #:use-module (gnu packages gettext)
59 #:use-module (gnu packages ghostscript)
60 #:use-module (gnu packages gl)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gnome)
63 #:use-module (gnu packages gnupg)
64 #:use-module (gnu packages gstreamer)
65 #:use-module (gnu packages gtk)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages imagemagick)
68 #:use-module (gnu packages javascript)
69 #:use-module (gnu packages lesstif)
70 #:use-module (gnu packages libffi)
71 #:use-module (gnu packages linux)
72 #:use-module (gnu packages lua)
73 #:use-module (gnu packages pcre)
74 #:use-module (gnu packages perl)
75 #:use-module (gnu packages photo)
76 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages python)
78 #:use-module (gnu packages python-check)
79 #:use-module (gnu packages python-web)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages qt)
82 #:use-module (gnu packages sdl)
83 #:use-module (gnu packages sphinx)
84 #:use-module (gnu packages sqlite)
85 #:use-module (gnu packages tls)
86 #:use-module (gnu packages xdisorg)
87 #:use-module (gnu packages xorg)
88 #:use-module (srfi srfi-1))
90 (define-public poppler
96 (uri (string-append "https://poppler.freedesktop.org/poppler-"
100 "0ccp2gx05cz5y04k5pgbyi4ikyq60nafa7x2yx4aaf1vfkd318f7"))))
101 (build-system cmake-build-system)
104 (inputs `(("fontconfig" ,fontconfig)
105 ("freetype" ,freetype)
106 ("libjpeg" ,libjpeg-turbo)
110 ("openjpeg" ,openjpeg)
113 ;; To build poppler-glib (as needed by Evince), we need Cairo and
114 ;; GLib. But of course, that Cairo must not depend on Poppler.
115 ("cairo" ,(package (inherit cairo)
116 (inputs (alist-delete "poppler"
117 (package-inputs cairo)))))))
119 ;; As per poppler-cairo and poppler-glib.pc.
120 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
121 ;; different solution to the circular dependency mentioned above.
124 `(("pkg-config" ,pkg-config)
125 ("glib" ,glib "bin") ; glib-mkenums, etc.
126 ("gobject-introspection" ,gobject-introspection)))
128 `(#:tests? #f ; no test data provided with the tarball
130 (let* ((out (assoc-ref %outputs "out"))
131 (lib (string-append out "/lib")))
132 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
134 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
135 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
136 (synopsis "PDF rendering library")
138 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
139 (license license:gpl2+)
140 (home-page "https://poppler.freedesktop.org/")))
142 (define-public poppler-data
144 (name "poppler-data")
148 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
149 "-" version ".tar.gz"))
152 "04i0wgdkn5lhda8cyxd1ll4a2p41pwqrwd47n9mdpl7cx5ypx70z"))))
153 (build-system gnu-build-system)
155 '(#:tests? #f ; no test suite
156 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
158 (modify-phases %standard-phases
159 ;; The package only provides some data files, so there is nothing to
163 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
164 (description "This package provides optional encoding files for Poppler.
165 When present, Poppler is able to correctly render CJK and Cyrillic text.")
166 (home-page (package-home-page poppler))
167 ;; See COPYING in the source distribution for more information about
169 (license (list license:bsd-3
172 (define-public poppler-qt4
173 (package/inherit poppler
175 (inputs `(("qt-4" ,qt-4)
176 ,@(package-inputs poppler)))
177 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
179 (define-public poppler-qt5
180 (package/inherit poppler
182 (inputs `(("qtbase" ,qtbase)
183 ,@(package-inputs poppler)))
184 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
186 (define-public python-poppler-qt5
188 (name "python-poppler-qt5")
193 (uri (pypi-uri "python-poppler-qt5" version))
196 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
197 (build-system python-build-system)
199 `(;; There are no tests. The check phase just causes a rebuild.
202 (modify-phases %standard-phases
204 (lambda* (#:key inputs #:allow-other-keys)
205 (substitute* "setup.py"
206 ;; This check always fails, so disable it.
207 (("if not check_qtxml\\(\\)")
209 ;; We need to pass an extra flag here. This cannot be in
210 ;; configure-flags because it should not be passed for the
211 ;; installation phase.
212 ((@@ (guix build python-build-system) call-setuppy)
213 "build_ext" (list (string-append "--pyqt-sip-dir="
214 (assoc-ref inputs "python-pyqt")
215 "/share/sip")) #t))))))
217 `(("pkg-config" ,pkg-config)))
219 `(("python-sip" ,python-sip)
220 ("python-pyqt" ,python-pyqt)
221 ("poppler-qt5" ,poppler-qt5)
223 (home-page "https://pypi.python.org/pypi/python-poppler-qt5")
224 (synopsis "Python bindings for Poppler-Qt5")
226 "This package provides Python bindings for the Qt5 interface of the
227 Poppler PDF rendering library.")
228 (license license:lgpl2.1+)))
230 (define-public libharu
237 (url "https://github.com/libharu/libharu.git")
238 (commit (string-append
240 (string-join (string-split version #\.) "_")))))
241 (file-name (git-file-name name version))
244 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
245 (build-system gnu-build-system)
248 (list (string-append "--with-zlib="
249 (assoc-ref %build-inputs "zlib"))
250 (string-append "--with-png="
251 (assoc-ref %build-inputs "libpng")))))
256 `(("autoconf" ,autoconf)
257 ("automake" ,automake)
258 ("libtool" ,libtool)))
259 (home-page "http://libharu.org/")
260 (synopsis "Library for generating PDF files")
262 "libHaru is a library for generating PDF files. libHaru does not support
263 reading and editing of existing PDF files.")
264 (license license:zlib)))
272 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
275 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
276 (build-system gnu-build-system)
277 (inputs `(("freetype" ,freetype)
278 ("gs-fonts" ,gs-fonts)
280 ("libpaper" ,libpaper)
289 `(#:tests? #f ; there is no check target
290 #:parallel-build? #f ; build fails randomly on 8-way machines
292 (list (string-append "--with-freetype2-includes="
293 (assoc-ref %build-inputs "freetype")
294 "/include/freetype2"))
296 (modify-phases %standard-phases
298 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
299 (let* ((install (assoc-ref %standard-phases 'install))
300 (out (assoc-ref outputs "out"))
301 (xpdfrc (string-append out "/etc/xpdfrc"))
302 (gs-fonts (assoc-ref inputs "gs-fonts")))
305 (("/usr/local/share/ghostscript/fonts")
306 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
307 (("#fontFile") "fontFile")))
309 (synopsis "Viewer for PDF files based on the Motif toolkit")
311 "Xpdf is a viewer for Portable Document Format (PDF) files.")
312 (license license:gpl3) ; or gpl2, but not gpl2+
313 (home-page "http://www.foolabs.com/xpdf/")))
315 (define-public zathura-cb
322 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
326 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
327 (native-inputs `(("pkg-config" ,pkg-config)))
328 (inputs `(("libarchive" ,libarchive)
329 ("zathura" ,zathura)))
330 (build-system meson-build-system)
332 `(#:tests? #f ; package does not contain tests
334 (modify-phases %standard-phases
335 (add-after 'unpack 'patch-plugin-directory
336 ;; Something of a regression in 0.1.8: the new Meson build system
337 ;; now hard-codes an incorrect plugin directory. Fix it.
338 (lambda* (#:key outputs #:allow-other-keys)
339 (substitute* "meson.build"
340 (("(install_dir:).*" _ key)
342 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
344 (home-page "https://pwmt.org/projects/zathura-cb/")
345 (synopsis "Comic book support for zathura (libarchive backend)")
346 (description "The zathura-cb plugin adds comic book support to zathura
348 (license license:zlib)))
350 (define-public zathura-ps
357 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
361 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
362 (native-inputs `(("pkg-config" ,pkg-config)))
363 (inputs `(("libspectre" ,libspectre)
364 ("zathura" ,zathura)))
365 (build-system meson-build-system)
367 `(#:tests? #f ; package does not contain tests
369 (modify-phases %standard-phases
370 (add-after 'unpack 'patch-plugin-directory
371 ;; Something of a regression in 0.2.6: the new Meson build system
372 ;; now hard-codes an incorrect plugin directory. Fix it.
373 (lambda* (#:key outputs #:allow-other-keys)
374 (substitute* "meson.build"
375 (("(install_dir:).*" _ key)
377 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
379 (home-page "https://pwmt.org/projects/zathura-ps/")
380 (synopsis "PS support for zathura (libspectre backend)")
381 (description "The zathura-ps plugin adds PS support to zathura
383 (license license:zlib)))
385 (define-public zathura-djvu
387 (name "zathura-djvu")
392 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
396 "0axkv1crdxn0z44whaqp2ibkdqcykhjnxk7qzms0dp1b67an9rnh"))))
397 (native-inputs `(("pkg-config" ,pkg-config)))
399 `(("djvulibre" ,djvulibre)
400 ("zathura" ,zathura)))
401 (build-system meson-build-system)
403 `(#:tests? #f ; package does not contain tests
405 (modify-phases %standard-phases
406 (add-after 'unpack 'patch-plugin-directory
407 ;; Something of a regression in 0.2.8: the new Meson build system
408 ;; now hard-codes an incorrect plugin directory. Fix it.
409 (lambda* (#:key outputs #:allow-other-keys)
410 (substitute* "meson.build"
411 (("(install_dir:).*" _ key)
413 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
415 (home-page "https://pwmt.org/projects/zathura-djvu/")
416 (synopsis "DjVu support for zathura (DjVuLibre backend)")
417 (description "The zathura-djvu plugin adds DjVu support to zathura
418 using the DjVuLibre library.")
419 (license license:zlib)))
421 (define-public zathura-pdf-mupdf
423 (name "zathura-pdf-mupdf")
428 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
429 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
432 "1pjwsb7zwclxsvz229fl7y2saf1pv3ifwv3ay8viqxgrp9x3z9hq"))))
433 (native-inputs `(("pkg-config" ,pkg-config)))
435 `(("jbig2dec" ,jbig2dec)
436 ("libjpeg" ,libjpeg-turbo)
439 ("openjpeg" ,openjpeg)
441 ("zathura" ,zathura)))
442 (build-system meson-build-system)
444 `(#:tests? #f ; package does not contain tests
445 #:configure-flags (list (string-append "-Dplugindir="
446 (assoc-ref %outputs "out")
448 "-Dlink-external=true")
450 (modify-phases %standard-phases
451 (add-before 'configure 'add-mujs-to-dependencies
453 ;; Add mujs to the 'build_dependencies'.
454 (substitute* "meson.build"
455 (("^ libopenjp2 = dependency.*" x)
456 (string-append x " mujs = cc.find_library('mujs')\n"))
458 " libopenjp2, mujs")))))))
459 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
460 (synopsis "PDF support for zathura (mupdf backend)")
461 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
462 by using the @code{mupdf} rendering library.")
463 (license license:zlib)))
465 (define-public zathura-pdf-poppler
467 (name "zathura-pdf-poppler")
472 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
476 "1p4jcny0jniygns78mcf0nlm298dszh49qpmjmackrm6dq8hc25y"))))
477 (native-inputs `(("pkg-config" ,pkg-config)))
479 `(("poppler" ,poppler)
480 ("zathura" ,zathura)))
481 (build-system meson-build-system)
483 `(#:tests? #f ; package does not include tests
485 (modify-phases %standard-phases
486 (add-after 'unpack 'patch-plugin-directory
487 ;; Something of a regression in 0.2.9: the new Meson build system
488 ;; now hard-codes an incorrect plugin directory. Fix it.
489 (lambda* (#:key outputs #:allow-other-keys)
490 (substitute* "meson.build"
491 (("(install_dir:).*" _ key)
493 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
495 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
496 (synopsis "PDF support for zathura (poppler backend)")
497 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
498 by using the poppler rendering engine.")
499 (license license:zlib)))
501 (define-public zathura
508 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
512 "0hgx5x09i6d0z45llzdmh4l348fxh1y102sb1w76f2fp4r21j4ky"))))
513 (native-inputs `(("pkg-config" ,pkg-config)
514 ("gettext" ,gettext-minimal)
515 ("glib:bin" ,glib "bin")
517 ;; For building documentation.
518 ("python-sphinx" ,python-sphinx)
520 ;; For building icons.
525 ("xorg-server" ,xorg-server-for-tests)))
526 (inputs `(("sqlite" ,sqlite)))
527 ;; Listed in 'Requires.private' of 'zathura.pc'.
528 (propagated-inputs `(("cairo" ,cairo)
531 (list (search-path-specification
532 (variable "ZATHURA_PLUGINS_PATH")
533 (files '("lib/zathura")))))
534 (build-system meson-build-system)
536 `(#:phases (modify-phases %standard-phases
537 (add-before 'check 'start-xserver
538 ;; Tests require a running X server.
539 (lambda* (#:key inputs #:allow-other-keys)
540 (let ((xorg-server (assoc-ref inputs "xorg-server"))
542 (setenv "DISPLAY" display)
544 ;; On busy machines, tests may take longer than
545 ;; the default of four seconds.
546 (setenv "CK_DEFAULT_TIMEOUT" "20")
548 ;; Don't fail due to missing '/etc/machine-id'.
549 (setenv "DBUS_FATAL_WARNINGS" "0")
550 (zero? (system (string-append xorg-server "/bin/Xvfb "
551 display " &")))))))))
552 (home-page "https://pwmt.org/projects/zathura/")
553 (synopsis "Lightweight keyboard-driven PDF viewer")
554 (description "Zathura is a customizable document viewer. It provides a
555 minimalistic interface and an interface that mainly focuses on keyboard
557 (license license:zlib)))
559 (define-public podofo
565 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
566 "/podofo-" version ".tar.gz"))
569 "0wj0y4zcmj4q79wrn3vv3xq4bb0vhhxs8yifafwy9f2sjm83c5p9"))
570 (patches (search-patches "podofo-cmake-3.12.patch"))))
571 (build-system cmake-build-system)
573 `(("cppunit" ,cppunit)
574 ("pkg-config" ,pkg-config)))
576 `(("libjpeg" ,libjpeg-turbo)
578 ("fontconfig" ,fontconfig)
579 ("freetype" ,freetype)
585 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
586 "-DPODOFO_BUILD_STATIC=ON")
588 (modify-phases %standard-phases
589 (add-before 'configure 'patch
590 (lambda* (#:key inputs #:allow-other-keys)
591 (let ((freetype (assoc-ref inputs "freetype")))
592 ;; Look for freetype include files in the correct place.
593 (substitute* "cmake/modules/FindFREETYPE.cmake"
594 (("/usr/local") freetype)))
596 (home-page "http://podofo.sourceforge.net")
597 (synopsis "Tools to work with the PDF file format")
599 "PoDoFo is a C++ library and set of command-line tools to work with the
600 PDF file format. It can parse PDF files and load them into memory, and makes
601 it easy to modify them and write the changes to disk. It is primarily useful
602 for applications that wish to do lower level manipulation of PDF, such as
603 extracting content or merging files.")
604 (license license:lgpl2.0+)))
613 (uri (string-append "https://mupdf.com/downloads/archive/"
614 name "-" version "-source.tar.xz"))
617 "1npmy92lkj41nnc14b4fpq7z62pminy94zsdbrczj22jpn283rvg"))
618 (modules '((guix build utils)))
620 ;; We keep lcms2 since it is different than our lcms.
624 (delete-file-recursively (string-append "thirdparty/" dir)))
625 '("freeglut" "freetype" "harfbuzz" "jbig2dec"
626 "libjpeg" "mujs" "openjpeg" "zlib"))
628 (build-system gnu-build-system)
631 ("freeglut" ,freeglut)
632 ("freetype" ,freetype)
633 ("harfbuzz" ,harfbuzz)
634 ("jbig2dec" ,jbig2dec)
635 ("libjpeg" ,libjpeg-turbo)
639 ("openjpeg" ,openjpeg)
643 `(("pkg-config" ,pkg-config)))
645 '(#:tests? #f ; no check target
646 #:make-flags (list "CC=gcc"
648 "USE_SYSTEM_LIBS=yes"
649 "USE_SYSTEM_MUJS=yes"
650 (string-append "prefix=" (assoc-ref %outputs "out")))
651 #:phases (modify-phases %standard-phases
652 (delete 'configure))))
653 (home-page "https://mupdf.com")
654 (synopsis "Lightweight PDF viewer and toolkit")
656 "MuPDF is a C library that implements a PDF and XPS parsing and
657 rendering engine. It is used primarily to render pages into bitmaps,
658 but also provides support for other operations such as searching and
659 listing the table of contents and hyperlinks.
661 The library ships with a rudimentary X11 viewer, and a set of command
662 line tools for batch rendering @command{pdfdraw}, rewriting files
663 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
664 (license (list license:agpl3+
665 license:bsd-3 ; resources/cmaps
666 license:x11 ; thirdparty/lcms2
667 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
668 license:asl2.0)))) ; resources/fonts/droid
676 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
677 "/qpdf-" version ".tar.gz"))
680 "0ygd80wxcmh613n04x2kmf8wlsl0drxyd5wwdcrm1rzj0xwvpfrs"))
681 (modules '((guix build utils)))
683 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
684 ;; dependency on Perl.
686 (substitute* "qpdf/fix-qdf"
687 (("#!/usr/bin/env perl")
689 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
690 & eval 'exec perl -wS \"$0\" $argv:q'
693 (build-system gnu-build-system)
695 `(#:disallowed-references (,perl)
697 (modify-phases %standard-phases
698 (add-before 'configure 'patch-paths
700 (substitute* "make/libtool.mk"
702 (string-append "SHELL=" (which "bash"))))
704 '("qtest/bin/qtest-driver")
705 (find-files "." "\\.test"))
706 (("/usr/bin/env") (which "env")))
709 `(("pkg-config" ,pkg-config)
712 ;; In Requires.private of libqpdf.pc.
713 `(("libjpeg-turbo" ,libjpeg-turbo)
715 (synopsis "Command-line tools and library for transforming PDF files")
717 "QPDF is a command-line program that does structural, content-preserving
718 transformations on PDF files. It could have been called something like
719 pdf-to-pdf. It includes support for merging and splitting PDFs and to
720 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
721 program capable of converting PDF into other formats.")
722 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
723 ;; Users can still choose to use the old license at their option.
724 (license (list license:asl2.0 license:clarified-artistic))
725 (home-page "http://qpdf.sourceforge.net/")))
727 (define-public xournal
730 (version "0.4.8.2016")
734 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
735 "/xournal-" version ".tar.gz"))
738 "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
739 (build-system gnu-build-system)
745 ("libgnomecanvas" ,libgnomecanvas)))
747 `(("pkg-config" ,pkg-config)))
748 (home-page "http://xournal.sourceforge.net/")
749 (synopsis "Notetaking using a stylus")
751 "Xournal is an application for notetaking, sketching, keeping a journal
753 (license license:gpl2+)))
755 (define-public python-reportlab
757 (name "python-reportlab")
761 (uri (pypi-uri "reportlab" version))
764 "0lf8hil9nbm74zl27l8rydxbhwnpr0pbghibsqrc9sglds9l9vw3"))))
765 (build-system python-build-system)
767 '(;; FIXME: There is one test failure, but it does not cause the
768 ;; build to fail. No time to investigate right now.
769 #:test-target "tests"))
771 `(("freetype" ,freetype)))
773 `(("python-pillow" ,python-pillow)))
774 (home-page "https://www.reportlab.com")
775 (synopsis "Python library for generating PDFs and graphics")
776 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
777 of rich PDF documents, and also creation of charts in a variety of bitmap and
779 (license license:bsd-3)))
781 (define-public python2-reportlab
782 (package-with-python2 python-reportlab))
784 (define-public impressive
791 "mirror://sourceforge/impressive/Impressive/"
792 version "/Impressive-" version ".tar.gz"))
795 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
796 (build-system python-build-system)
798 ;; TODO: Add dependency on pdftk.
799 (inputs `(("python2-pygame" ,python2-pygame)
800 ("python2-pillow" ,python2-pillow)
806 #:phases (modify-phases %standard-phases
811 (lambda* (#:key inputs outputs #:allow-other-keys)
812 ;; There's no 'setup.py' so install things manually.
813 (let* ((out (assoc-ref outputs "out"))
814 (bin (string-append out "/bin"))
815 (man1 (string-append out "/share/man/man1"))
816 (sdl (assoc-ref inputs "sdl"))
817 (xpdf (assoc-ref inputs "xpdf")))
819 (copy-file "impressive.py"
820 (string-append bin "/impressive"))
821 (wrap-program (string-append bin "/impressive")
822 `("LIBRARY_PATH" ":" prefix ;for ctypes
823 (,(string-append sdl "/lib")))
824 `("PATH" ":" prefix ;for pdftoppm
825 (,(string-append xpdf "/bin"))))
826 (install-file "impressive.1" man1)
828 (home-page "http://impressive.sourceforge.net")
829 (synopsis "PDF presentation tool with visual effects")
831 "Impressive is a tool to display PDF files that provides visual effects
832 such as smooth alpha-blended slide transitions. It provides additional tools
833 such as zooming, highlighting an area of the screen, and a tool to navigate
835 (license license:gpl2)))
841 (home-page "https://www.kraxel.org/blog/linux/fbida/")
844 (uri (string-append "https://www.kraxel.org/releases/fbida/"
845 "fbida-" version ".tar.gz"))
848 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
849 (build-system gnu-build-system)
852 (modify-phases %standard-phases
853 (add-after 'unpack 'patch-FHS-file-names
855 (substitute* "mk/Autoconf.mk"
856 (("/bin/echo") "echo")
857 (("/sbin/ldconfig -p") "echo lib")) #t))
860 #:make-flags (list "CC=gcc"
861 (string-append "prefix=" (assoc-ref %outputs "out")))))
862 (inputs `(("libjpeg" ,libjpeg-turbo)
868 ("imagemagick" ,imagemagick)
871 ("cairo-xcb" ,cairo-xcb)
872 ("freetype" ,freetype)
873 ("fontconfig" ,fontconfig)
876 ("libepoxy" ,libepoxy)
878 ("poppler" ,poppler)))
879 (native-inputs `(("pkg-config" ,pkg-config)))
880 (synopsis "Framebuffer and drm-based image viewer")
882 "fbida contains a few applications for viewing and editing images on
885 (license license:gpl2+)))
887 (define-public pdf2svg
894 (url "https://github.com/dawbarton/pdf2svg.git")
895 (commit (string-append "v" version))))
896 (file-name (git-file-name name version))
899 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
900 (build-system gnu-build-system)
903 ("poppler" ,poppler)))
905 `(("pkg-config" ,pkg-config)))
906 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
907 (synopsis "PDF to SVG converter")
908 (description "@command{pdf2svg} is a simple command-line PDF to SVG
909 converter using the Poppler and Cairo libraries.")
910 (license license:gpl2+)))
912 (define-public python-pypdf2
914 (name "python-pypdf2")
918 (uri (pypi-uri "PyPDF2" version))
921 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
922 (build-system python-build-system)
925 (modify-phases %standard-phases
927 'unpack 'patch-test-suite
929 ;; The text-file needs to be opened in binary mode for Python 3,
930 ;; so patch in the "b"
931 (substitute* "Tests/tests.py"
932 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
933 (string-append line "b")))
937 (invoke "python" "-m" "unittest" "Tests.tests"))))))
938 (home-page "http://mstamy2.github.com/PyPDF2")
939 (synopsis "Pure Python PDF toolkit")
940 (description "PyPDF2 is a pure Python PDF library capable of:
943 @item extracting document information (title, author, …)
944 @item splitting documents page by page
945 @item merging documents page by page
947 @item merging multiple pages into a single page
948 @item encrypting and decrypting PDF files
951 By being pure Python, it should run on any Python platform without any
952 dependencies on external libraries. It can also work entirely on
953 @code{StringIO} objects rather than file streams, allowing for PDF
954 manipulation in memory. It is therefore a useful tool for websites that
955 manage or manipulate PDFs.")
956 (license license:bsd-3)))
958 (define-public python2-pypdf2
959 (package-with-python2 python-pypdf2))
961 (define-public python2-pypdf
963 (name "python2-pypdf")
967 (uri (pypi-uri "pyPdf" version))
970 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
971 (build-system python-build-system)
973 `(#:tests? #f ; no tests
975 (home-page "http://pybrary.net/pyPdf/")
976 (synopsis "Pure Python PDF toolkit")
977 (description "PyPDF2 is a pure Python PDF toolkit.
979 Note: This module isn't maintained anymore. For new projects please use
980 python-pypdf2 instead.")
981 (license license:bsd-3)))
983 (define-public pdfarranger
991 (url "https://github.com/jeromerobert/pdfarranger.git")
993 (file-name (git-file-name name version))
995 (base32 "1f8m8r81322i97wkqpmf7a4kiwnq244n6cnbldh03jc49vwq2kxx"))))
996 (build-system python-build-system)
998 '(#:tests? #f ;no tests
999 #:phases (modify-phases %standard-phases
1000 (add-after 'install 'wrap-for-typelib
1001 (lambda* (#:key inputs outputs #:allow-other-keys)
1002 (let* ((out (assoc-ref outputs "out"))
1003 (program (string-append out "/bin/pdfarranger")))
1004 (wrap-program program
1005 `("GI_TYPELIB_PATH" ":" prefix
1006 (,(getenv "GI_TYPELIB_PATH"))))
1009 `(("intltool" ,intltool)
1010 ("python-distutils-extra" ,python-distutils-extra)))
1013 ("poppler" ,poppler)
1014 ("python-pycairo" ,python-pycairo)
1015 ("python-pygobject" ,python-pygobject)
1016 ("python-pypdf2" ,python-pypdf2)))
1017 (home-page "https://github.com/jeromerobert/pdfarranger")
1018 (synopsis "Merge, split and re-arrange pages from PDF documents")
1020 "PDF Arranger is a small application which allows one to merge or split
1021 PDF documents and rotate, crop and rearrange their pages using an interactive
1022 and intuitive graphical interface.
1024 PDF Arranger was formerly known as PDF-Shuffler.")
1025 (license license:gpl3+)))
1027 (define-public pdfposter
1030 (version "0.7.post1")
1033 (uri (pypi-uri "pdftools.pdfposter" version))
1036 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
1037 (build-system python-build-system)
1039 `(#:tests? #f)) ; test-suite not included in source archive
1041 `(("python-pypdf2" ,python-pypdf2)))
1042 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1043 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1044 (description "@command{pdfposter} can be used to create a large poster by
1045 building it from multiple pages and/or printing it on large media. It expects
1046 as input a PDF file, normally printing on a single page. The output is again
1047 a PDF file, maybe containing multiple pages together building the poster. The
1048 input page will be scaled to obtain the desired size.
1050 This is much like @command{poster} does for Postscript files, but working with
1051 PDF. Since sometimes @command{poster} does not like your files converted from
1052 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1053 (license license:gpl3+)))
1055 (define-public pdfgrep
1062 (uri (string-append "https://pdfgrep.org/download/"
1063 name "-" version ".tar.gz"))
1066 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
1067 (build-system gnu-build-system)
1069 `(("pkg-config" ,pkg-config)))
1071 `(("libgcrypt" ,libgcrypt)
1073 ("poppler" ,poppler)))
1074 (home-page "https://pdfgrep.org")
1075 (synopsis "Command-line utility to search text in PDF files")
1077 "Pdfgrep searches in pdf files for strings matching a regular expression.
1078 Support some GNU grep options as file name output, page number output,
1079 optional case insensitivity, count occurrences, color highlights and search in
1081 (license license:gpl2+)))
1083 (define-public pdfpc
1091 (url "https://github.com/pdfpc/pdfpc.git")
1092 (commit (string-append "v" version))))
1093 (file-name (git-file-name name version))
1095 (base32 "07aafsm4jzdgpahz83p0ajv40hry7gviyadqi13ahr8xdhhwy2sd"))))
1096 (build-system cmake-build-system)
1097 (arguments '(#:tests? #f)) ; no test target
1101 ("gstreamer" ,gstreamer)
1102 ("gst-plugins-base" ,gst-plugins-base)
1104 ("poppler" ,poppler)
1108 `(("pkg-config" ,pkg-config)))
1109 (home-page "https://pdfpc.github.io/")
1110 (synopsis "Presenter console with multi-monitor support for PDF files")
1112 "pdfpc is a presentation viewer application which uses multi-monitor
1113 output to provide meta information to the speaker during the presentation. It
1114 is able to show a normal presentation window on one screen, while showing a
1115 more sophisticated overview on the other one providing information like a
1116 picture of the next slide, as well as the left over time till the end of the
1117 presentation. The input files processed by pdfpc are PDF documents.")
1118 (license license:gpl2+)))
1127 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1128 version "/paps-" version ".tar.gz"))
1130 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1131 (build-system gnu-build-system)
1133 `(("pango" ,pango)))
1135 `(("intltool" ,intltool)
1136 ("pkg-config" ,pkg-config)))
1137 (home-page "https://github.com/dov/paps")
1138 (synopsis "Pango to PostScript converter")
1140 "Paps reads a UTF-8 encoded file and generates a PostScript language
1141 rendering of the file. The rendering is done by creating outline curves
1142 through the Pango @code{ft2} backend.")
1143 (license license:lgpl2.0+)))
1145 (define-public stapler
1153 (url "https://github.com/hellerbarde/stapler")
1155 (file-name (git-file-name name version))
1158 "06w7xanzr7cicqik62g7zqs57j4y6fc7hflrc1rlmphxx40hkg6r"))))
1159 (build-system python-build-system)
1161 `(("python2-pypdf2" ,python2-pypdf2)))
1163 `(#:python ,python-2
1165 (modify-phases %standard-phases
1166 (add-after 'unpack 'fix-pypdf-version-requirement
1167 ;; A PyPDF2 version requirement of 1.25.1 is hard-coded in
1168 ;; setup.py. Relax it to work with any version of PyPDF2.
1170 (substitute* "setup.py"
1171 (("PyPDF2==1.25.1") "PyPDF2"))
1173 (home-page "https://github.com/hellerbarde/stapler")
1174 (synopsis "PDF manipulation tool")
1175 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1176 manipulating PDF documents from the command line. It supports
1179 @item cherry-picking pages and concatenating them into a new file
1180 @item splitting a PDF document into single pages each in its own file
1181 @item merging PDF documents with their pages interleaved
1182 @item displaying metadata in a PDF document
1183 @item displaying the mapping between logical and physical page numbers
1185 (license license:bsd-3)))
1187 (define-public weasyprint
1194 (uri (pypi-uri "WeasyPrint" version))
1196 (base32 "0invs96zvmcr6wh5klj52jrcnr9qg150v9wpmbhcsf3vv1d1hbcw"))
1197 (patches (search-patches "weasyprint-library-paths.patch"))))
1198 (build-system python-build-system)
1201 (modify-phases %standard-phases
1202 (add-after 'unpack 'patch-library-paths
1203 (lambda* (#:key inputs #:allow-other-keys)
1204 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1205 (glib (assoc-ref inputs "glib"))
1206 (pango (assoc-ref inputs "pango"))
1207 (pangoft2 (assoc-ref inputs "pangoft2")))
1208 (substitute* "weasyprint/fonts.py"
1210 (string-append fontconfig "/lib/libfontconfig.so"))
1212 (string-append pango "/lib/libpangoft2-1.0.so")))
1213 (substitute* "weasyprint/text.py"
1215 (string-append glib "/lib/libgobject-2.0.so"))
1217 (string-append pango "/lib/libpango-1.0.so"))
1219 (string-append pango "/lib/libpangocairo-1.0.so"))))))
1220 (add-after 'unpack 'remove-pytest-options
1222 (substitute* "setup.cfg"
1223 ;; flake8 and isort syntax checks fail, which is not our
1225 (("addopts = --flake8 --isort") ""))))
1228 ;; run pytest, excluding one failing test
1229 (invoke "pytest" "-k" "not test_flex_column_wrap_reverse"))))))
1231 `(("fontconfig" ,fontconfig)
1235 `(("gdk-pixbuf" ,gdk-pixbuf)
1236 ("python-cairocffi" ,python-cairocffi)
1237 ("python-cairosvg" ,python-cairosvg)
1238 ("python-cffi" ,python-cffi)
1239 ("python-cssselect2" ,python-cssselect2)
1240 ("python-html5lib" ,python-html5lib)
1241 ("python-pyphen" ,python-pyphen)
1242 ("python-tinycss2" ,python-tinycss2)))
1244 `(("python-pytest-cov" ,python-pytest-cov)
1245 ("python-pytest-runner" ,python-pytest-runner)))
1246 (home-page "https://weasyprint.org/")
1247 (synopsis "Document factory for creating PDF files from HTML")
1248 (description "WeasyPrint helps web developers to create PDF documents. It
1249 turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1252 From a technical point of view, WeasyPrint is a visual rendering engine for
1253 HTML and CSS that can export to PDF and PNG. It aims to support web standards
1256 It is based on various libraries but not on a full rendering engine like
1257 WebKit or Gecko. The CSS layout engine is written in Python, designed for
1258 pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1261 Keywords: html2pdf, htmltopdf")
1262 (license license:bsd-3)))