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,2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
20 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
22 ;;; This file is part of GNU Guix.
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37 (define-module (gnu packages pdf)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix packages)
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module (guix utils)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system meson)
46 #:use-module (guix build-system python)
47 #:use-module (guix build-system trivial)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages audio)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages backup)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages check)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages curl)
57 #:use-module (gnu packages djvu)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages game-development)
60 #:use-module (gnu packages gcc)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages ghostscript)
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages gnome)
66 #:use-module (gnu packages gnupg)
67 #:use-module (gnu packages gstreamer)
68 #:use-module (gnu packages gtk)
69 #:use-module (gnu packages image)
70 #:use-module (gnu packages imagemagick)
71 #:use-module (gnu packages javascript)
72 #:use-module (gnu packages lesstif)
73 #:use-module (gnu packages libffi)
74 #:use-module (gnu packages linux)
75 #:use-module (gnu packages lua)
76 #:use-module (gnu packages pcre)
77 #:use-module (gnu packages perl)
78 #:use-module (gnu packages photo)
79 #:use-module (gnu packages pkg-config)
80 #:use-module (gnu packages pulseaudio)
81 #:use-module (gnu packages python)
82 #:use-module (gnu packages python-check)
83 #:use-module (gnu packages python-web)
84 #:use-module (gnu packages python-xyz)
85 #:use-module (gnu packages qt)
86 #:use-module (gnu packages sdl)
87 #:use-module (gnu packages sphinx)
88 #:use-module (gnu packages sqlite)
89 #:use-module (gnu packages tex)
90 #:use-module (gnu packages tls)
91 #:use-module (gnu packages xdisorg)
92 #:use-module (gnu packages xml)
93 #:use-module (gnu packages xorg)
94 #:use-module (srfi srfi-1))
96 (define-public flyer-composer
98 (name "flyer-composer")
103 (uri (pypi-uri "flyer-composer" version))
105 (base32 "17igqb5dlcgcq4nimjw6cf9qgz6a728zdx1d0rr90r2z0llcchsv"))))
106 (build-system python-build-system)
108 `(#:tests? #f ;; TODO
110 (modify-phases %standard-phases
111 (add-after 'install 'wrap-executable
112 (lambda* (#:key inputs outputs #:allow-other-keys)
113 (let* ((out (assoc-ref outputs "out"))
114 (qtbase (assoc-ref inputs "qtbase"))
115 (qml "/lib/qt5/qml"))
116 (wrap-program (string-append out "/bin/flyer-composer-gui")
117 `("QT_PLUGIN_PATH" ":" =
118 (,(string-append qtbase "/lib/qt5/plugins")))
119 `("QT_QPA_PLATFORM_PLUGIN_PATH" ":" =
120 (,(string-append qtbase "/lib/qt5/plugins/platforms"))))
123 `(("python-pypdf2" ,python-pypdf2)
124 ("python-pyqt" ,python-pyqt)
125 ("python-poppler-qt5" ,python-poppler-qt5)
127 (home-page "http://crazy-compilers.com/flyer-composer")
128 (synopsis "Rearrange PDF pages to print as flyers on one sheet")
129 (description "@command{flyer-composer} can be used to prepare one- or
130 two-sided flyers for printing on one sheet of paper.
132 Imagine you have designed a flyer in A6 format and want to print it using your
133 A4 printer. Of course, you want to print four flyers on each sheet. This is
134 where Flyer Composer steps in, creating a PDF which holds your flyer four
135 times. If you have a second page, Flyer Composer can arrange it the same way
136 - even if the second page is in a separate PDF file.
138 This package contains both the commnd line tool and the gui too.")
139 (license license:agpl3+)))
141 (define-public poppler
147 (uri (string-append "https://poppler.freedesktop.org/poppler-"
151 "1j18jlv1q6h21azb939gqjsgcbsh5qcd8dwxdmad54p5ixha91gr"))))
152 (build-system cmake-build-system)
155 (inputs `(("fontconfig" ,fontconfig)
156 ("freetype" ,freetype)
157 ("libjpeg" ,libjpeg-turbo)
161 ("openjpeg" ,openjpeg)
164 ;; To build poppler-glib (as needed by Evince), we need Cairo and
165 ;; GLib. But of course, that Cairo must not depend on Poppler.
166 ("cairo" ,(package (inherit cairo)
167 (inputs (alist-delete "poppler"
168 (package-inputs cairo)))))))
170 ;; As per poppler-cairo and poppler-glib.pc.
171 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
172 ;; different solution to the circular dependency mentioned above.
175 `(("pkg-config" ,pkg-config)
176 ("glib" ,glib "bin") ; glib-mkenums, etc.
177 ("gobject-introspection" ,gobject-introspection)))
179 `(#:tests? #f ; no test data provided with the tarball
181 (let* ((out (assoc-ref %outputs "out"))
182 (lib (string-append out "/lib")))
183 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
185 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
186 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
187 (synopsis "PDF rendering library")
189 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
190 (license license:gpl2+)
191 (home-page "https://poppler.freedesktop.org/")))
193 (define-public poppler-data
195 (name "poppler-data")
199 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
200 "-" version ".tar.gz"))
203 "04i0wgdkn5lhda8cyxd1ll4a2p41pwqrwd47n9mdpl7cx5ypx70z"))))
204 (build-system gnu-build-system)
206 '(#:tests? #f ; no test suite
207 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
209 (modify-phases %standard-phases
210 ;; The package only provides some data files, so there is nothing to
214 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
215 (description "This package provides optional encoding files for Poppler.
216 When present, Poppler is able to correctly render CJK and Cyrillic text.")
217 (home-page (package-home-page poppler))
218 ;; See COPYING in the source distribution for more information about
220 (license (list license:bsd-3
223 (define-public poppler-qt4
224 (package/inherit poppler
226 (inputs `(("qt-4" ,qt-4)
227 ,@(package-inputs poppler)))
228 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
230 (define-public poppler-qt5
231 (package/inherit poppler
233 (inputs `(("qtbase" ,qtbase)
234 ,@(package-inputs poppler)))
235 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
237 (define-public python-poppler-qt5
239 (name "python-poppler-qt5")
244 (uri (pypi-uri "python-poppler-qt5" version))
247 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
248 (build-system python-build-system)
250 `(;; There are no tests. The check phase just causes a rebuild.
253 (modify-phases %standard-phases
255 (lambda* (#:key inputs #:allow-other-keys)
256 (substitute* "setup.py"
257 ;; This check always fails, so disable it.
258 (("if not check_qtxml\\(\\)")
260 ;; We need to pass an extra flag here. This cannot be in
261 ;; configure-flags because it should not be passed for the
262 ;; installation phase.
263 ((@@ (guix build python-build-system) call-setuppy)
264 "build_ext" (list (string-append "--pyqt-sip-dir="
265 (assoc-ref inputs "python-pyqt")
266 "/share/sip")) #t))))))
268 `(("pkg-config" ,pkg-config)))
270 `(("python-sip" ,python-sip)
271 ("python-pyqt" ,python-pyqt)
272 ("poppler-qt5" ,poppler-qt5)
274 (home-page "https://pypi.org/project/python-poppler-qt5/")
275 (synopsis "Python bindings for Poppler-Qt5")
277 "This package provides Python bindings for the Qt5 interface of the
278 Poppler PDF rendering library.")
279 (license license:lgpl2.1+)))
281 (define-public libharu
288 (url "https://github.com/libharu/libharu.git")
289 (commit (string-append
291 (string-join (string-split version #\.) "_")))))
292 (file-name (git-file-name name version))
295 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
296 (build-system gnu-build-system)
299 (list (string-append "--with-zlib="
300 (assoc-ref %build-inputs "zlib"))
301 (string-append "--with-png="
302 (assoc-ref %build-inputs "libpng")))))
307 `(("autoconf" ,autoconf)
308 ("automake" ,automake)
309 ("libtool" ,libtool)))
310 (home-page "http://libharu.org/")
311 (synopsis "Library for generating PDF files")
313 "libHaru is a library for generating PDF files. libHaru does not support
314 reading and editing of existing PDF files.")
315 (license license:zlib)))
324 (uri (string-append "https://xpdfreader-dl.s3.amazonaws.com/xpdf-"
325 version "4.02.tar.gz"))
327 (base32 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
328 (build-system gnu-build-system)
329 (inputs `(("freetype" ,freetype)
330 ("gs-fonts" ,gs-fonts)
332 ("libpaper" ,libpaper)
341 `(#:tests? #f ; there is no check target
342 #:parallel-build? #f ; build fails randomly on 8-way machines
344 (list (string-append "--with-freetype2-includes="
345 (assoc-ref %build-inputs "freetype")
346 "/include/freetype2"))
348 (modify-phases %standard-phases
350 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
351 (let* ((install (assoc-ref %standard-phases 'install))
352 (out (assoc-ref outputs "out"))
353 (xpdfrc (string-append out "/etc/xpdfrc"))
354 (gs-fonts (assoc-ref inputs "gs-fonts")))
357 (("/usr/local/share/ghostscript/fonts")
358 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
359 (("#fontFile") "fontFile")))
361 (synopsis "Viewer for PDF files based on the Motif toolkit")
363 "Xpdf is a viewer for Portable Document Format (PDF) files.")
364 (license license:gpl3) ; or gpl2, but not gpl2+
365 (home-page "https://www.xpdfreader.com/")))
367 (define-public zathura-cb
374 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
378 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
379 (native-inputs `(("pkg-config" ,pkg-config)))
380 (inputs `(("libarchive" ,libarchive)
381 ("zathura" ,zathura)))
382 (build-system meson-build-system)
384 `(#:tests? #f ; package does not contain tests
386 (modify-phases %standard-phases
387 (add-after 'unpack 'patch-plugin-directory
388 ;; Something of a regression in 0.1.8: the new Meson build system
389 ;; now hard-codes an incorrect plugin directory. Fix it.
390 (lambda* (#:key outputs #:allow-other-keys)
391 (substitute* "meson.build"
392 (("(install_dir:).*" _ key)
394 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
396 (home-page "https://pwmt.org/projects/zathura-cb/")
397 (synopsis "Comic book support for zathura (libarchive backend)")
398 (description "The zathura-cb plugin adds comic book support to zathura
400 (license license:zlib)))
402 (define-public zathura-ps
409 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
413 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
414 (native-inputs `(("pkg-config" ,pkg-config)))
415 (inputs `(("libspectre" ,libspectre)
416 ("zathura" ,zathura)))
417 (build-system meson-build-system)
419 `(#:tests? #f ; package does not contain tests
421 (modify-phases %standard-phases
422 (add-after 'unpack 'patch-plugin-directory
423 ;; Something of a regression in 0.2.6: the new Meson build system
424 ;; now hard-codes an incorrect plugin directory. Fix it.
425 (lambda* (#:key outputs #:allow-other-keys)
426 (substitute* "meson.build"
427 (("(install_dir:).*" _ key)
429 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
431 (home-page "https://pwmt.org/projects/zathura-ps/")
432 (synopsis "PS support for zathura (libspectre backend)")
433 (description "The zathura-ps plugin adds PS support to zathura
435 (license license:zlib)))
437 (define-public zathura-djvu
439 (name "zathura-djvu")
444 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
448 "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"))))
449 (native-inputs `(("pkg-config" ,pkg-config)))
451 `(("djvulibre" ,djvulibre)
452 ("zathura" ,zathura)))
453 (build-system meson-build-system)
455 `(#:tests? #f ; package does not contain tests
457 (modify-phases %standard-phases
458 (add-after 'unpack 'patch-plugin-directory
459 ;; Something of a regression in 0.2.8: the new Meson build system
460 ;; now hard-codes an incorrect plugin directory. Fix it.
461 (lambda* (#:key outputs #:allow-other-keys)
462 (substitute* "meson.build"
463 (("(install_dir:).*" _ key)
465 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
467 (home-page "https://pwmt.org/projects/zathura-djvu/")
468 (synopsis "DjVu support for zathura (DjVuLibre backend)")
469 (description "The zathura-djvu plugin adds DjVu support to zathura
470 using the DjVuLibre library.")
471 (license license:zlib)))
473 (define-public zathura-pdf-mupdf
475 (name "zathura-pdf-mupdf")
480 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
481 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
484 "1pjwsb7zwclxsvz229fl7y2saf1pv3ifwv3ay8viqxgrp9x3z9hq"))))
485 (native-inputs `(("pkg-config" ,pkg-config)))
487 `(("jbig2dec" ,jbig2dec)
491 ("openjpeg" ,openjpeg)
493 ("zathura" ,zathura)))
494 (build-system meson-build-system)
496 `(#:tests? #f ; package does not contain tests
497 #:configure-flags (list (string-append "-Dplugindir="
498 (assoc-ref %outputs "out")
500 "-Dlink-external=true")
502 (modify-phases %standard-phases
503 (add-before 'configure 'add-mujs-to-dependencies
505 ;; Add mujs to the 'build_dependencies'.
506 (substitute* "meson.build"
507 (("^ libopenjp2 = dependency.*" x)
508 (string-append x " mujs = cc.find_library('mujs')\n"))
510 " libopenjp2, mujs")))))))
511 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
512 (synopsis "PDF support for zathura (mupdf backend)")
513 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
514 by using the @code{mupdf} rendering library.")
515 (license license:zlib)))
517 (define-public zathura-pdf-poppler
519 (name "zathura-pdf-poppler")
524 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
528 "1vfl4vkyy3rf39r1sqaa7y8113bgkh2bkfq3nn2inis9mrykmk6m"))))
529 (native-inputs `(("pkg-config" ,pkg-config)))
531 `(("poppler" ,poppler)
532 ("zathura" ,zathura)))
533 (build-system meson-build-system)
535 `(#:tests? #f ; package does not include tests
537 (modify-phases %standard-phases
538 (add-after 'unpack 'patch-plugin-directory
539 ;; Something of a regression in 0.2.9: the new Meson build system
540 ;; now hard-codes an incorrect plugin directory. Fix it.
541 (lambda* (#:key outputs #:allow-other-keys)
542 (substitute* "meson.build"
543 (("(install_dir:).*" _ key)
545 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
547 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
548 (synopsis "PDF support for zathura (poppler backend)")
549 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
550 by using the poppler rendering engine.")
551 (license license:zlib)))
553 (define-public zathura
560 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
564 "0b3nrcvykkpv2vm99kijnic2gpfzva520bsjlihaxandzfm9ff8c"))))
565 (native-inputs `(("pkg-config" ,pkg-config)
566 ("gettext" ,gettext-minimal)
567 ("glib:bin" ,glib "bin")
569 ;; For building documentation.
570 ("python-sphinx" ,python-sphinx)
572 ;; For building icons.
577 ("xorg-server" ,xorg-server-for-tests)))
578 (inputs `(("sqlite" ,sqlite)))
579 ;; Listed in 'Requires.private' of 'zathura.pc'.
580 (propagated-inputs `(("cairo" ,cairo)
583 (list (search-path-specification
584 (variable "ZATHURA_PLUGINS_PATH")
585 (files '("lib/zathura")))))
586 (build-system meson-build-system)
588 `(#:phases (modify-phases %standard-phases
589 (add-before 'check 'start-xserver
590 ;; Tests require a running X server.
591 (lambda* (#:key inputs #:allow-other-keys)
592 (let ((xorg-server (assoc-ref inputs "xorg-server"))
594 (setenv "DISPLAY" display)
596 ;; On busy machines, tests may take longer than
597 ;; the default of four seconds.
598 (setenv "CK_DEFAULT_TIMEOUT" "20")
600 ;; Don't fail due to missing '/etc/machine-id'.
601 (setenv "DBUS_FATAL_WARNINGS" "0")
602 (zero? (system (string-append xorg-server "/bin/Xvfb "
603 display " &")))))))))
604 (home-page "https://pwmt.org/projects/zathura/")
605 (synopsis "Lightweight keyboard-driven PDF viewer")
606 (description "Zathura is a customizable document viewer. It provides a
607 minimalistic interface and an interface that mainly focuses on keyboard
609 (license license:zlib)))
611 (define-public podofo
617 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
618 "/podofo-" version ".tar.gz"))
621 "0wj0y4zcmj4q79wrn3vv3xq4bb0vhhxs8yifafwy9f2sjm83c5p9"))
622 (patches (search-patches "podofo-cmake-3.12.patch"))))
623 (build-system cmake-build-system)
625 `(("cppunit" ,cppunit)
626 ("pkg-config" ,pkg-config)))
628 `(("libjpeg" ,libjpeg)
630 ("fontconfig" ,fontconfig)
631 ("freetype" ,freetype)
637 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
638 "-DPODOFO_BUILD_STATIC=ON")
640 (modify-phases %standard-phases
641 (add-before 'configure 'patch
642 (lambda* (#:key inputs #:allow-other-keys)
643 (let ((freetype (assoc-ref inputs "freetype")))
644 ;; Look for freetype include files in the correct place.
645 (substitute* "cmake/modules/FindFREETYPE.cmake"
646 (("/usr/local") freetype)))
648 (home-page "http://podofo.sourceforge.net")
649 (synopsis "Tools to work with the PDF file format")
651 "PoDoFo is a C++ library and set of command-line tools to work with the
652 PDF file format. It can parse PDF files and load them into memory, and makes
653 it easy to modify them and write the changes to disk. It is primarily useful
654 for applications that wish to do lower level manipulation of PDF, such as
655 extracting content or merging files.")
656 (license license:lgpl2.0+)))
665 (uri (string-append "https://mupdf.com/downloads/archive/"
666 name "-" version "-source.tar.xz"))
669 "1npmy92lkj41nnc14b4fpq7z62pminy94zsdbrczj22jpn283rvg"))
670 (modules '((guix build utils)))
672 ;; We keep lcms2 since it is different than our lcms.
676 (delete-file-recursively (string-append "thirdparty/" dir)))
677 '("freeglut" "freetype" "harfbuzz" "jbig2dec"
678 "libjpeg" "mujs" "openjpeg" "zlib"))
680 (build-system gnu-build-system)
683 ("freeglut" ,freeglut)
684 ("freetype" ,freetype)
685 ("harfbuzz" ,harfbuzz)
686 ("jbig2dec" ,jbig2dec)
691 ("openjpeg" ,openjpeg)
695 `(("pkg-config" ,pkg-config)))
697 '(#:tests? #f ; no check target
698 #:make-flags (list "CC=gcc"
700 "USE_SYSTEM_LIBS=yes"
701 "USE_SYSTEM_MUJS=yes"
702 (string-append "prefix=" (assoc-ref %outputs "out")))
703 #:phases (modify-phases %standard-phases
704 (delete 'configure))))
705 (home-page "https://mupdf.com")
706 (synopsis "Lightweight PDF viewer and toolkit")
708 "MuPDF is a C library that implements a PDF and XPS parsing and
709 rendering engine. It is used primarily to render pages into bitmaps,
710 but also provides support for other operations such as searching and
711 listing the table of contents and hyperlinks.
713 The library ships with a rudimentary X11 viewer, and a set of command
714 line tools for batch rendering @command{pdfdraw}, rewriting files
715 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
716 (license (list license:agpl3+
717 license:bsd-3 ; resources/cmaps
718 license:x11 ; thirdparty/lcms2
719 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
720 license:asl2.0)))) ; resources/fonts/droid
728 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
729 "/qpdf-" version ".tar.gz"))
732 "0dj27wb9xg6pg95phbflfvy9rwxn1gh3kc4n175g0pf41r0zrim2"))))
733 (build-system gnu-build-system)
735 `(#:disallowed-references (,perl)
737 (modify-phases %standard-phases
738 (add-before 'configure 'patch-paths
740 (substitute* "make/libtool.mk"
742 (string-append "SHELL=" (which "bash"))))
744 '("qtest/bin/qtest-driver")
745 (find-files "." "\\.test"))
746 (("/usr/bin/env") (which "env")))
749 `(("pkg-config" ,pkg-config)
752 ;; In Requires.private of libqpdf.pc.
753 `(("libjpeg-turbo" ,libjpeg-turbo)
755 (synopsis "Command-line tools and library for transforming PDF files")
757 "QPDF is a command-line program that does structural, content-preserving
758 transformations on PDF files. It could have been called something like
759 pdf-to-pdf. It includes support for merging and splitting PDFs and to
760 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
761 program capable of converting PDF into other formats.")
762 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
763 ;; Users can still choose to use the old license at their option.
764 (license (list license:asl2.0 license:clarified-artistic))
765 (home-page "http://qpdf.sourceforge.net/")))
767 (define-public xournal
770 (version "0.4.8.2016")
774 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
775 "/xournal-" version ".tar.gz"))
778 "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
779 (build-system gnu-build-system)
785 ("libgnomecanvas" ,libgnomecanvas)))
787 `(("pkg-config" ,pkg-config)))
788 (home-page "http://xournal.sourceforge.net/")
789 (synopsis "Notetaking using a stylus")
791 "Xournal is an application for notetaking, sketching, keeping a journal
793 (license license:gpl2+)))
795 (define-public xournalpp
803 (url "https://github.com/xournalpp/xournalpp.git")
805 (file-name (git-file-name name version))
807 (base32 "0xw2mcgnm4sa9hrhfgp669lfypw97drxjmz5w8i5whaprpvmkxzw"))))
808 (build-system cmake-build-system)
810 `(#:configure-flags (list "-DENABLE_CPPUNIT=ON") ;enable tests
811 #:imported-modules ((guix build glib-or-gtk-build-system)
812 ,@%cmake-build-system-modules)
813 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
814 (guix build cmake-build-system)
817 (modify-phases %standard-phases
818 (add-after 'unpack 'fix-permissions-on-po-files
820 ;; Always generate translations. A recent upstream patch
822 (substitute* "po/CMakeLists.txt"
823 (("gettext_create_translations \\(\"\\$\\{potfile\\}\"\\)")
824 "gettext_create_translations (\"${potfile}\" ALL)"))
825 ;; Make sure 'msgmerge' can modify the PO files.
826 (for-each (lambda (po) (chmod po #o666))
827 (find-files "." "\\.po$"))
829 (add-after 'install 'glib-or-gtk-wrap
830 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
832 `(("cppunit" ,cppunit)
833 ("gcc" ,gcc-8) ;requires gcc 8+
834 ("gettext" ,gettext-minimal)
835 ("pkg-config" ,pkg-config)))
837 `(("alsa-lib" ,alsa-lib)
840 ("libsndfile" ,libsndfile)
843 ("lua" ,lua) ;FIXME: It cannot find the Lua library.
845 ("portaudio" ,portaudio)
846 ("texlive-bin" ,texlive-bin)))
847 (home-page "https://github.com/xournalpp/xournalpp")
848 (synopsis "Handwriting notetaking software with PDF annotation support")
849 (description "Xournal++ is a hand note taking software written in
850 C++ with the target of flexibility, functionality and speed. Stroke
851 recognizer and other parts are based on Xournal code.
856 @item Support for Pen pressure, e.g., Wacom Tablet
857 @item Support for annotating PDFs
858 @item Fill shape functionality
859 @item PDF Export (with and without paper style)
860 @item PNG Export (with and without transparent background)
861 @item Allow to map different tools / colors etc. to stylus buttons /
863 @item Sidebar with Page Previews with advanced page sorting, PDF
864 Bookmarks and Layers (can be individually hidden, editing layer can be
866 @item enhanced support for image insertion
867 @item Eraser with multiple configurations
869 @item bug reporting, autosave, and auto backup tools
870 @item Customizeable toolbar, with multiple configurations, e.g., to
871 optimize toolbar for portrait / landscape
872 @item Page Template definitions
873 @item Shape drawing (line, arrow, circle, rectangle)
874 @item Shape resizing and rotation
875 @item Rotation snapping every 45 degrees
876 @item Rect snapping to grid
877 @item Audio recording and playback alongside with handwritten notes
878 @item Multi Language Support, Like English, German, Italian...
879 @item Plugins using LUA Scripting
881 (license license:gpl2+)))
883 (define-public python-reportlab
885 (name "python-reportlab")
889 (uri (pypi-uri "reportlab" version))
892 "0lf8hil9nbm74zl27l8rydxbhwnpr0pbghibsqrc9sglds9l9vw3"))))
893 (build-system python-build-system)
895 '(;; FIXME: There is one test failure, but it does not cause the
896 ;; build to fail. No time to investigate right now.
897 #:test-target "tests"))
899 `(("freetype" ,freetype)))
901 `(("python-pillow" ,python-pillow)))
902 (home-page "https://www.reportlab.com")
903 (synopsis "Python library for generating PDFs and graphics")
904 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
905 of rich PDF documents, and also creation of charts in a variety of bitmap and
907 (license license:bsd-3)))
909 (define-public python2-reportlab
910 (package-with-python2 python-reportlab))
912 (define-public impressive
919 "mirror://sourceforge/impressive/Impressive/"
920 version "/Impressive-" version ".tar.gz"))
923 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
924 (build-system python-build-system)
926 ;; TODO: Add dependency on pdftk.
927 (inputs `(("python2-pygame" ,python2-pygame)
928 ("python2-pillow" ,python2-pillow)
934 #:phases (modify-phases %standard-phases
939 (lambda* (#:key inputs outputs #:allow-other-keys)
940 ;; There's no 'setup.py' so install things manually.
941 (let* ((out (assoc-ref outputs "out"))
942 (bin (string-append out "/bin"))
943 (man1 (string-append out "/share/man/man1"))
944 (sdl (assoc-ref inputs "sdl"))
945 (xpdf (assoc-ref inputs "xpdf")))
947 (copy-file "impressive.py"
948 (string-append bin "/impressive"))
949 (wrap-program (string-append bin "/impressive")
950 `("LIBRARY_PATH" ":" prefix ;for ctypes
951 (,(string-append sdl "/lib")))
952 `("PATH" ":" prefix ;for pdftoppm
953 (,(string-append xpdf "/bin"))))
954 (install-file "impressive.1" man1)
956 (home-page "http://impressive.sourceforge.net")
957 (synopsis "PDF presentation tool with visual effects")
959 "Impressive is a tool to display PDF files that provides visual effects
960 such as smooth alpha-blended slide transitions. It provides additional tools
961 such as zooming, highlighting an area of the screen, and a tool to navigate
963 (license license:gpl2)))
969 (home-page "https://www.kraxel.org/blog/linux/fbida/")
972 (uri (string-append "https://www.kraxel.org/releases/fbida/"
973 "fbida-" version ".tar.gz"))
976 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
977 (build-system gnu-build-system)
980 (modify-phases %standard-phases
981 (add-after 'unpack 'patch-FHS-file-names
983 (substitute* "mk/Autoconf.mk"
984 (("/bin/echo") "echo")
985 (("/sbin/ldconfig -p") "echo lib")) #t))
988 #:make-flags (list "CC=gcc"
989 (string-append "prefix=" (assoc-ref %outputs "out")))))
990 (inputs `(("libjpeg" ,libjpeg)
996 ("imagemagick" ,imagemagick)
999 ("cairo-xcb" ,cairo-xcb)
1000 ("freetype" ,freetype)
1001 ("fontconfig" ,fontconfig)
1002 ("libexif" ,libexif)
1004 ("libepoxy" ,libepoxy)
1006 ("poppler" ,poppler)))
1007 (native-inputs `(("pkg-config" ,pkg-config)))
1008 (synopsis "Framebuffer and drm-based image viewer")
1010 "fbida contains a few applications for viewing and editing images on
1013 (license license:gpl2+)))
1015 (define-public pdf2svg
1022 (url "https://github.com/dawbarton/pdf2svg.git")
1023 (commit (string-append "v" version))))
1024 (file-name (git-file-name name version))
1027 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
1028 (build-system gnu-build-system)
1031 ("poppler" ,poppler)))
1033 `(("pkg-config" ,pkg-config)))
1034 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
1035 (synopsis "PDF to SVG converter")
1036 (description "@command{pdf2svg} is a simple command-line PDF to SVG
1037 converter using the Poppler and Cairo libraries.")
1038 (license license:gpl2+)))
1040 (define-public python-pypdf2
1042 (name "python-pypdf2")
1046 (uri (pypi-uri "PyPDF2" version))
1049 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
1050 (build-system python-build-system)
1053 (modify-phases %standard-phases
1055 'unpack 'patch-test-suite
1057 ;; The text-file needs to be opened in binary mode for Python 3,
1058 ;; so patch in the "b"
1059 (substitute* "Tests/tests.py"
1060 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
1061 (string-append line "b")))
1065 (invoke "python" "-m" "unittest" "Tests.tests"))))))
1066 (home-page "http://mstamy2.github.com/PyPDF2")
1067 (synopsis "Pure Python PDF toolkit")
1068 (description "PyPDF2 is a pure Python PDF library capable of:
1071 @item extracting document information (title, author, …)
1072 @item splitting documents page by page
1073 @item merging documents page by page
1074 @item cropping pages
1075 @item merging multiple pages into a single page
1076 @item encrypting and decrypting PDF files
1079 By being pure Python, it should run on any Python platform without any
1080 dependencies on external libraries. It can also work entirely on
1081 @code{StringIO} objects rather than file streams, allowing for PDF
1082 manipulation in memory. It is therefore a useful tool for websites that
1083 manage or manipulate PDFs.")
1084 (license license:bsd-3)))
1086 (define-public python2-pypdf2
1087 (package-with-python2 python-pypdf2))
1089 (define-public python2-pypdf
1091 (name "python2-pypdf")
1095 (uri (pypi-uri "pyPdf" version))
1098 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
1099 (build-system python-build-system)
1101 `(#:tests? #f ; no tests
1102 #:python ,python-2))
1103 (home-page "http://pybrary.net/pyPdf/")
1104 (synopsis "Pure Python PDF toolkit")
1105 (description "PyPDF2 is a pure Python PDF toolkit.
1107 Note: This module isn't maintained anymore. For new projects please use
1108 python-pypdf2 instead.")
1109 (license license:bsd-3)))
1111 (define-public pdfarranger
1113 (name "pdfarranger")
1119 (url "https://github.com/jeromerobert/pdfarranger.git")
1121 (file-name (git-file-name name version))
1123 (base32 "1f8m8r81322i97wkqpmf7a4kiwnq244n6cnbldh03jc49vwq2kxx"))))
1124 (build-system python-build-system)
1126 '(#:tests? #f ;no tests
1127 #:phases (modify-phases %standard-phases
1128 (add-after 'install 'wrap-for-typelib
1129 (lambda* (#:key inputs outputs #:allow-other-keys)
1130 (let* ((out (assoc-ref outputs "out"))
1131 (program (string-append out "/bin/pdfarranger")))
1132 (wrap-program program
1133 `("GI_TYPELIB_PATH" ":" prefix
1134 (,(getenv "GI_TYPELIB_PATH"))))
1137 `(("intltool" ,intltool)
1138 ("python-distutils-extra" ,python-distutils-extra)))
1141 ("poppler" ,poppler)
1142 ("python-pycairo" ,python-pycairo)
1143 ("python-pygobject" ,python-pygobject)
1144 ("python-pypdf2" ,python-pypdf2)))
1145 (home-page "https://github.com/jeromerobert/pdfarranger")
1146 (synopsis "Merge, split and re-arrange pages from PDF documents")
1148 "PDF Arranger is a small application which allows one to merge or split
1149 PDF documents and rotate, crop and rearrange their pages using an interactive
1150 and intuitive graphical interface.
1152 PDF Arranger was formerly known as PDF-Shuffler.")
1153 (license license:gpl3+)))
1155 (define-public pdfposter
1158 (version "0.7.post1")
1161 (uri (pypi-uri "pdftools.pdfposter" version))
1164 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
1165 (build-system python-build-system)
1167 `(#:tests? #f)) ; test-suite not included in source archive
1169 `(("python-pypdf2" ,python-pypdf2)))
1170 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1171 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1172 (description "@command{pdfposter} can be used to create a large poster by
1173 building it from multiple pages and/or printing it on large media. It expects
1174 as input a PDF file, normally printing on a single page. The output is again
1175 a PDF file, maybe containing multiple pages together building the poster. The
1176 input page will be scaled to obtain the desired size.
1178 This is much like @command{poster} does for Postscript files, but working with
1179 PDF. Since sometimes @command{poster} does not like your files converted from
1180 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1181 (license license:gpl3+)))
1183 (define-public pdfgrep
1190 (uri (string-append "https://pdfgrep.org/download/"
1191 name "-" version ".tar.gz"))
1194 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
1195 (build-system gnu-build-system)
1197 `(("pkg-config" ,pkg-config)))
1199 `(("libgcrypt" ,libgcrypt)
1201 ("poppler" ,poppler)))
1202 (home-page "https://pdfgrep.org")
1203 (synopsis "Command-line utility to search text in PDF files")
1205 "Pdfgrep searches in pdf files for strings matching a regular expression.
1206 Support some GNU grep options as file name output, page number output,
1207 optional case insensitivity, count occurrences, color highlights and search in
1209 (license license:gpl2+)))
1211 (define-public pdfpc
1219 (url "https://github.com/pdfpc/pdfpc.git")
1220 (commit (string-append "v" version))))
1221 (file-name (git-file-name name version))
1223 (base32 "07aafsm4jzdgpahz83p0ajv40hry7gviyadqi13ahr8xdhhwy2sd"))))
1224 (build-system cmake-build-system)
1225 (arguments '(#:tests? #f)) ; no test target
1229 ("gstreamer" ,gstreamer)
1230 ("gst-plugins-base" ,gst-plugins-base)
1232 ("poppler" ,poppler)
1236 `(("pkg-config" ,pkg-config)))
1237 (home-page "https://pdfpc.github.io/")
1238 (synopsis "Presenter console with multi-monitor support for PDF files")
1240 "pdfpc is a presentation viewer application which uses multi-monitor
1241 output to provide meta information to the speaker during the presentation. It
1242 is able to show a normal presentation window on one screen, while showing a
1243 more sophisticated overview on the other one providing information like a
1244 picture of the next slide, as well as the left over time till the end of the
1245 presentation. The input files processed by pdfpc are PDF documents.")
1246 (license license:gpl2+)))
1255 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1256 version "/paps-" version ".tar.gz"))
1258 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1259 (build-system gnu-build-system)
1261 `(("pango" ,pango)))
1263 `(("intltool" ,intltool)
1264 ("pkg-config" ,pkg-config)))
1265 (home-page "https://github.com/dov/paps")
1266 (synopsis "Pango to PostScript converter")
1268 "Paps reads a UTF-8 encoded file and generates a PostScript language
1269 rendering of the file. The rendering is done by creating outline curves
1270 through the Pango @code{ft2} backend.")
1271 (license license:lgpl2.0+)))
1273 (define-public stapler
1281 (url "https://github.com/hellerbarde/stapler")
1283 (file-name (git-file-name name version))
1286 "06w7xanzr7cicqik62g7zqs57j4y6fc7hflrc1rlmphxx40hkg6r"))))
1287 (build-system python-build-system)
1289 `(("python2-pypdf2" ,python2-pypdf2)))
1291 `(#:python ,python-2
1293 (modify-phases %standard-phases
1294 (add-after 'unpack 'fix-pypdf-version-requirement
1295 ;; A PyPDF2 version requirement of 1.25.1 is hard-coded in
1296 ;; setup.py. Relax it to work with any version of PyPDF2.
1298 (substitute* "setup.py"
1299 (("PyPDF2==1.25.1") "PyPDF2"))
1301 (home-page "https://github.com/hellerbarde/stapler")
1302 (synopsis "PDF manipulation tool")
1303 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1304 manipulating PDF documents from the command line. It supports
1307 @item cherry-picking pages and concatenating them into a new file
1308 @item splitting a PDF document into single pages each in its own file
1309 @item merging PDF documents with their pages interleaved
1310 @item displaying metadata in a PDF document
1311 @item displaying the mapping between logical and physical page numbers
1313 (license license:bsd-3)))
1315 (define-public weasyprint
1322 (uri (pypi-uri "WeasyPrint" version))
1324 (base32 "0skdzwq7cd715dnnds6abx0k0xmmnmsqp0vb1r1w20sg7abp3sdk"))
1325 (patches (search-patches "weasyprint-library-paths.patch"))))
1326 (build-system python-build-system)
1329 (modify-phases %standard-phases
1330 (add-after 'unpack 'patch-library-paths
1331 (lambda* (#:key inputs #:allow-other-keys)
1332 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1333 (glib (assoc-ref inputs "glib"))
1334 (pango (assoc-ref inputs "pango"))
1335 (pangoft2 (assoc-ref inputs "pangoft2")))
1336 (substitute* "weasyprint/fonts.py"
1338 (string-append fontconfig "/lib/libfontconfig.so"))
1340 (string-append pango "/lib/libpangoft2-1.0.so")))
1341 (substitute* "weasyprint/text.py"
1343 (string-append glib "/lib/libgobject-2.0.so"))
1345 (string-append pango "/lib/libpango-1.0.so"))
1347 (string-append pango "/lib/libpangocairo-1.0.so"))))))
1348 (add-after 'unpack 'remove-pytest-options
1350 (substitute* "setup.cfg"
1351 ;; flake8 and isort syntax checks fail, which is not our
1353 (("addopts = --flake8 --isort") ""))))
1356 ;; Run pytest, excluding one failing test.
1357 (invoke "pytest" "-k" "not test_flex_column_wrap_reverse"))))))
1359 `(("fontconfig" ,fontconfig)
1363 `(("gdk-pixbuf" ,gdk-pixbuf)
1364 ("python-cairocffi" ,python-cairocffi)
1365 ("python-cairosvg" ,python-cairosvg)
1366 ("python-cffi" ,python-cffi)
1367 ("python-cssselect2" ,python-cssselect2)
1368 ("python-html5lib" ,python-html5lib)
1369 ("python-pyphen" ,python-pyphen)
1370 ("python-tinycss2" ,python-tinycss2)))
1372 `(("python-pytest-cov" ,python-pytest-cov)
1373 ("python-pytest-runner" ,python-pytest-runner)))
1374 (home-page "https://weasyprint.org/")
1375 (synopsis "Document factory for creating PDF files from HTML")
1376 (description "WeasyPrint helps web developers to create PDF documents. It
1377 turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1380 From a technical point of view, WeasyPrint is a visual rendering engine for
1381 HTML and CSS that can export to PDF and PNG. It aims to support web standards
1384 It is based on various libraries but not on a full rendering engine like
1385 WebKit or Gecko. The CSS layout engine is written in Python, designed for
1386 pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1389 Keywords: html2pdf, htmltopdf")
1390 (license license:bsd-3)))