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>
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 poppler
102 (uri (string-append "https://poppler.freedesktop.org/poppler-"
106 "0v3z4mk1rr8i0c4cfkab7pnxdbil30j4cm4w6cqlq6cfghkhlqxg"))))
107 (build-system cmake-build-system)
110 (inputs `(("fontconfig" ,fontconfig)
111 ("freetype" ,freetype)
112 ("libjpeg" ,libjpeg-turbo)
116 ("openjpeg" ,openjpeg)
119 ;; To build poppler-glib (as needed by Evince), we need Cairo and
120 ;; GLib. But of course, that Cairo must not depend on Poppler.
121 ("cairo" ,(package (inherit cairo)
122 (inputs (alist-delete "poppler"
123 (package-inputs cairo)))))))
125 ;; As per poppler-cairo and poppler-glib.pc.
126 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
127 ;; different solution to the circular dependency mentioned above.
130 `(("pkg-config" ,pkg-config)
131 ("glib" ,glib "bin") ; glib-mkenums, etc.
132 ("gobject-introspection" ,gobject-introspection)))
134 `(#:tests? #f ; no test data provided with the tarball
136 (let* ((out (assoc-ref %outputs "out"))
137 (lib (string-append out "/lib")))
138 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
140 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
141 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
142 (synopsis "PDF rendering library")
144 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
145 (license license:gpl2+)
146 (home-page "https://poppler.freedesktop.org/")))
148 (define-public poppler-data
150 (name "poppler-data")
154 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
155 "-" version ".tar.gz"))
158 "04i0wgdkn5lhda8cyxd1ll4a2p41pwqrwd47n9mdpl7cx5ypx70z"))))
159 (build-system gnu-build-system)
161 '(#:tests? #f ; no test suite
162 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
164 (modify-phases %standard-phases
165 ;; The package only provides some data files, so there is nothing to
169 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
170 (description "This package provides optional encoding files for Poppler.
171 When present, Poppler is able to correctly render CJK and Cyrillic text.")
172 (home-page (package-home-page poppler))
173 ;; See COPYING in the source distribution for more information about
175 (license (list license:bsd-3
178 (define-public poppler-qt4
179 (package/inherit poppler
181 (inputs `(("qt-4" ,qt-4)
182 ,@(package-inputs poppler)))
183 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
185 (define-public poppler-qt5
186 (package/inherit poppler
188 (inputs `(("qtbase" ,qtbase)
189 ,@(package-inputs poppler)))
190 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
192 (define-public python-poppler-qt5
194 (name "python-poppler-qt5")
199 (uri (pypi-uri "python-poppler-qt5" version))
202 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
203 (build-system python-build-system)
205 `(;; There are no tests. The check phase just causes a rebuild.
208 (modify-phases %standard-phases
210 (lambda* (#:key inputs #:allow-other-keys)
211 (substitute* "setup.py"
212 ;; This check always fails, so disable it.
213 (("if not check_qtxml\\(\\)")
215 ;; We need to pass an extra flag here. This cannot be in
216 ;; configure-flags because it should not be passed for the
217 ;; installation phase.
218 ((@@ (guix build python-build-system) call-setuppy)
219 "build_ext" (list (string-append "--pyqt-sip-dir="
220 (assoc-ref inputs "python-pyqt")
221 "/share/sip")) #t))))))
223 `(("pkg-config" ,pkg-config)))
225 `(("python-sip" ,python-sip)
226 ("python-pyqt" ,python-pyqt)
227 ("poppler-qt5" ,poppler-qt5)
229 (home-page "https://pypi.org/project/python-poppler-qt5/")
230 (synopsis "Python bindings for Poppler-Qt5")
232 "This package provides Python bindings for the Qt5 interface of the
233 Poppler PDF rendering library.")
234 (license license:lgpl2.1+)))
236 (define-public libharu
243 (url "https://github.com/libharu/libharu.git")
244 (commit (string-append
246 (string-join (string-split version #\.) "_")))))
247 (file-name (git-file-name name version))
250 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
251 (build-system gnu-build-system)
254 (list (string-append "--with-zlib="
255 (assoc-ref %build-inputs "zlib"))
256 (string-append "--with-png="
257 (assoc-ref %build-inputs "libpng")))))
262 `(("autoconf" ,autoconf)
263 ("automake" ,automake)
264 ("libtool" ,libtool)))
265 (home-page "http://libharu.org/")
266 (synopsis "Library for generating PDF files")
268 "libHaru is a library for generating PDF files. libHaru does not support
269 reading and editing of existing PDF files.")
270 (license license:zlib)))
279 (uri (string-append "https://xpdfreader-dl.s3.amazonaws.com/xpdf-"
280 version "4.02.tar.gz"))
282 (base32 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
283 (build-system gnu-build-system)
284 (inputs `(("freetype" ,freetype)
285 ("gs-fonts" ,gs-fonts)
287 ("libpaper" ,libpaper)
296 `(#:tests? #f ; there is no check target
297 #:parallel-build? #f ; build fails randomly on 8-way machines
299 (list (string-append "--with-freetype2-includes="
300 (assoc-ref %build-inputs "freetype")
301 "/include/freetype2"))
303 (modify-phases %standard-phases
305 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
306 (let* ((install (assoc-ref %standard-phases 'install))
307 (out (assoc-ref outputs "out"))
308 (xpdfrc (string-append out "/etc/xpdfrc"))
309 (gs-fonts (assoc-ref inputs "gs-fonts")))
312 (("/usr/local/share/ghostscript/fonts")
313 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
314 (("#fontFile") "fontFile")))
316 (synopsis "Viewer for PDF files based on the Motif toolkit")
318 "Xpdf is a viewer for Portable Document Format (PDF) files.")
319 (license license:gpl3) ; or gpl2, but not gpl2+
320 (home-page "https://www.xpdfreader.com/")))
322 (define-public zathura-cb
329 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
333 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
334 (native-inputs `(("pkg-config" ,pkg-config)))
335 (inputs `(("libarchive" ,libarchive)
336 ("zathura" ,zathura)))
337 (build-system meson-build-system)
339 `(#:tests? #f ; package does not contain tests
341 (modify-phases %standard-phases
342 (add-after 'unpack 'patch-plugin-directory
343 ;; Something of a regression in 0.1.8: the new Meson build system
344 ;; now hard-codes an incorrect plugin directory. Fix it.
345 (lambda* (#:key outputs #:allow-other-keys)
346 (substitute* "meson.build"
347 (("(install_dir:).*" _ key)
349 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
351 (home-page "https://pwmt.org/projects/zathura-cb/")
352 (synopsis "Comic book support for zathura (libarchive backend)")
353 (description "The zathura-cb plugin adds comic book support to zathura
355 (license license:zlib)))
357 (define-public zathura-ps
364 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
368 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
369 (native-inputs `(("pkg-config" ,pkg-config)))
370 (inputs `(("libspectre" ,libspectre)
371 ("zathura" ,zathura)))
372 (build-system meson-build-system)
374 `(#:tests? #f ; package does not contain tests
376 (modify-phases %standard-phases
377 (add-after 'unpack 'patch-plugin-directory
378 ;; Something of a regression in 0.2.6: the new Meson build system
379 ;; now hard-codes an incorrect plugin directory. Fix it.
380 (lambda* (#:key outputs #:allow-other-keys)
381 (substitute* "meson.build"
382 (("(install_dir:).*" _ key)
384 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
386 (home-page "https://pwmt.org/projects/zathura-ps/")
387 (synopsis "PS support for zathura (libspectre backend)")
388 (description "The zathura-ps plugin adds PS support to zathura
390 (license license:zlib)))
392 (define-public zathura-djvu
394 (name "zathura-djvu")
399 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
403 "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"))))
404 (native-inputs `(("pkg-config" ,pkg-config)))
406 `(("djvulibre" ,djvulibre)
407 ("zathura" ,zathura)))
408 (build-system meson-build-system)
410 `(#:tests? #f ; package does not contain tests
412 (modify-phases %standard-phases
413 (add-after 'unpack 'patch-plugin-directory
414 ;; Something of a regression in 0.2.8: the new Meson build system
415 ;; now hard-codes an incorrect plugin directory. Fix it.
416 (lambda* (#:key outputs #:allow-other-keys)
417 (substitute* "meson.build"
418 (("(install_dir:).*" _ key)
420 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
422 (home-page "https://pwmt.org/projects/zathura-djvu/")
423 (synopsis "DjVu support for zathura (DjVuLibre backend)")
424 (description "The zathura-djvu plugin adds DjVu support to zathura
425 using the DjVuLibre library.")
426 (license license:zlib)))
428 (define-public zathura-pdf-mupdf
430 (name "zathura-pdf-mupdf")
435 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
436 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
439 "1pjwsb7zwclxsvz229fl7y2saf1pv3ifwv3ay8viqxgrp9x3z9hq"))))
440 (native-inputs `(("pkg-config" ,pkg-config)))
442 `(("jbig2dec" ,jbig2dec)
443 ("libjpeg" ,libjpeg-turbo)
446 ("openjpeg" ,openjpeg)
448 ("zathura" ,zathura)))
449 (build-system meson-build-system)
451 `(#:tests? #f ; package does not contain tests
452 #:configure-flags (list (string-append "-Dplugindir="
453 (assoc-ref %outputs "out")
455 "-Dlink-external=true")
457 (modify-phases %standard-phases
458 (add-before 'configure 'add-mujs-to-dependencies
460 ;; Add mujs to the 'build_dependencies'.
461 (substitute* "meson.build"
462 (("^ libopenjp2 = dependency.*" x)
463 (string-append x " mujs = cc.find_library('mujs')\n"))
465 " libopenjp2, mujs")))))))
466 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
467 (synopsis "PDF support for zathura (mupdf backend)")
468 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
469 by using the @code{mupdf} rendering library.")
470 (license license:zlib)))
472 (define-public zathura-pdf-poppler
474 (name "zathura-pdf-poppler")
479 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
483 "1vfl4vkyy3rf39r1sqaa7y8113bgkh2bkfq3nn2inis9mrykmk6m"))))
484 (native-inputs `(("pkg-config" ,pkg-config)))
486 `(("poppler" ,poppler)
487 ("zathura" ,zathura)))
488 (build-system meson-build-system)
490 `(#:tests? #f ; package does not include tests
492 (modify-phases %standard-phases
493 (add-after 'unpack 'patch-plugin-directory
494 ;; Something of a regression in 0.2.9: the new Meson build system
495 ;; now hard-codes an incorrect plugin directory. Fix it.
496 (lambda* (#:key outputs #:allow-other-keys)
497 (substitute* "meson.build"
498 (("(install_dir:).*" _ key)
500 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
502 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
503 (synopsis "PDF support for zathura (poppler backend)")
504 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
505 by using the poppler rendering engine.")
506 (license license:zlib)))
508 (define-public zathura
515 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
519 "0b3nrcvykkpv2vm99kijnic2gpfzva520bsjlihaxandzfm9ff8c"))))
520 (native-inputs `(("pkg-config" ,pkg-config)
521 ("gettext" ,gettext-minimal)
522 ("glib:bin" ,glib "bin")
524 ;; For building documentation.
525 ("python-sphinx" ,python-sphinx)
527 ;; For building icons.
532 ("xorg-server" ,xorg-server-for-tests)))
533 (inputs `(("sqlite" ,sqlite)))
534 ;; Listed in 'Requires.private' of 'zathura.pc'.
535 (propagated-inputs `(("cairo" ,cairo)
538 (list (search-path-specification
539 (variable "ZATHURA_PLUGINS_PATH")
540 (files '("lib/zathura")))))
541 (build-system meson-build-system)
543 `(#:phases (modify-phases %standard-phases
544 (add-before 'check 'start-xserver
545 ;; Tests require a running X server.
546 (lambda* (#:key inputs #:allow-other-keys)
547 (let ((xorg-server (assoc-ref inputs "xorg-server"))
549 (setenv "DISPLAY" display)
551 ;; On busy machines, tests may take longer than
552 ;; the default of four seconds.
553 (setenv "CK_DEFAULT_TIMEOUT" "20")
555 ;; Don't fail due to missing '/etc/machine-id'.
556 (setenv "DBUS_FATAL_WARNINGS" "0")
557 (zero? (system (string-append xorg-server "/bin/Xvfb "
558 display " &")))))))))
559 (home-page "https://pwmt.org/projects/zathura/")
560 (synopsis "Lightweight keyboard-driven PDF viewer")
561 (description "Zathura is a customizable document viewer. It provides a
562 minimalistic interface and an interface that mainly focuses on keyboard
564 (license license:zlib)))
566 (define-public podofo
572 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
573 "/podofo-" version ".tar.gz"))
576 "0wj0y4zcmj4q79wrn3vv3xq4bb0vhhxs8yifafwy9f2sjm83c5p9"))
577 (patches (search-patches "podofo-cmake-3.12.patch"))))
578 (build-system cmake-build-system)
580 `(("cppunit" ,cppunit)
581 ("pkg-config" ,pkg-config)))
583 `(("libjpeg" ,libjpeg-turbo)
585 ("fontconfig" ,fontconfig)
586 ("freetype" ,freetype)
592 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
593 "-DPODOFO_BUILD_STATIC=ON")
595 (modify-phases %standard-phases
596 (add-before 'configure 'patch
597 (lambda* (#:key inputs #:allow-other-keys)
598 (let ((freetype (assoc-ref inputs "freetype")))
599 ;; Look for freetype include files in the correct place.
600 (substitute* "cmake/modules/FindFREETYPE.cmake"
601 (("/usr/local") freetype)))
603 (home-page "http://podofo.sourceforge.net")
604 (synopsis "Tools to work with the PDF file format")
606 "PoDoFo is a C++ library and set of command-line tools to work with the
607 PDF file format. It can parse PDF files and load them into memory, and makes
608 it easy to modify them and write the changes to disk. It is primarily useful
609 for applications that wish to do lower level manipulation of PDF, such as
610 extracting content or merging files.")
611 (license license:lgpl2.0+)))
620 (uri (string-append "https://mupdf.com/downloads/archive/"
621 name "-" version "-source.tar.xz"))
624 "1npmy92lkj41nnc14b4fpq7z62pminy94zsdbrczj22jpn283rvg"))
625 (modules '((guix build utils)))
627 ;; We keep lcms2 since it is different than our lcms.
631 (delete-file-recursively (string-append "thirdparty/" dir)))
632 '("freeglut" "freetype" "harfbuzz" "jbig2dec"
633 "libjpeg" "mujs" "openjpeg" "zlib"))
635 (build-system gnu-build-system)
638 ("freeglut" ,freeglut)
639 ("freetype" ,freetype)
640 ("harfbuzz" ,harfbuzz)
641 ("jbig2dec" ,jbig2dec)
642 ("libjpeg" ,libjpeg-turbo)
646 ("openjpeg" ,openjpeg)
650 `(("pkg-config" ,pkg-config)))
652 '(#:tests? #f ; no check target
653 #:make-flags (list "CC=gcc"
655 "USE_SYSTEM_LIBS=yes"
656 "USE_SYSTEM_MUJS=yes"
657 (string-append "prefix=" (assoc-ref %outputs "out")))
658 #:phases (modify-phases %standard-phases
659 (delete 'configure))))
660 (home-page "https://mupdf.com")
661 (synopsis "Lightweight PDF viewer and toolkit")
663 "MuPDF is a C library that implements a PDF and XPS parsing and
664 rendering engine. It is used primarily to render pages into bitmaps,
665 but also provides support for other operations such as searching and
666 listing the table of contents and hyperlinks.
668 The library ships with a rudimentary X11 viewer, and a set of command
669 line tools for batch rendering @command{pdfdraw}, rewriting files
670 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
671 (license (list license:agpl3+
672 license:bsd-3 ; resources/cmaps
673 license:x11 ; thirdparty/lcms2
674 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
675 license:asl2.0)))) ; resources/fonts/droid
683 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
684 "/qpdf-" version ".tar.gz"))
687 "0dj27wb9xg6pg95phbflfvy9rwxn1gh3kc4n175g0pf41r0zrim2"))))
688 (build-system gnu-build-system)
690 `(#:disallowed-references (,perl)
692 (modify-phases %standard-phases
693 (add-before 'configure 'patch-paths
695 (substitute* "make/libtool.mk"
697 (string-append "SHELL=" (which "bash"))))
699 '("qtest/bin/qtest-driver")
700 (find-files "." "\\.test"))
701 (("/usr/bin/env") (which "env")))
704 `(("pkg-config" ,pkg-config)
707 ;; In Requires.private of libqpdf.pc.
708 `(("libjpeg-turbo" ,libjpeg-turbo)
710 (synopsis "Command-line tools and library for transforming PDF files")
712 "QPDF is a command-line program that does structural, content-preserving
713 transformations on PDF files. It could have been called something like
714 pdf-to-pdf. It includes support for merging and splitting PDFs and to
715 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
716 program capable of converting PDF into other formats.")
717 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
718 ;; Users can still choose to use the old license at their option.
719 (license (list license:asl2.0 license:clarified-artistic))
720 (home-page "http://qpdf.sourceforge.net/")))
722 (define-public xournal
725 (version "0.4.8.2016")
729 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
730 "/xournal-" version ".tar.gz"))
733 "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
734 (build-system gnu-build-system)
740 ("libgnomecanvas" ,libgnomecanvas)))
742 `(("pkg-config" ,pkg-config)))
743 (home-page "http://xournal.sourceforge.net/")
744 (synopsis "Notetaking using a stylus")
746 "Xournal is an application for notetaking, sketching, keeping a journal
748 (license license:gpl2+)))
750 (define-public xournalpp
758 (url "https://github.com/xournalpp/xournalpp.git")
760 (file-name (git-file-name name version))
762 (base32 "0xw2mcgnm4sa9hrhfgp669lfypw97drxjmz5w8i5whaprpvmkxzw"))))
763 (build-system cmake-build-system)
765 `(#:configure-flags (list "-DENABLE_CPPUNIT=ON") ;enable tests
766 #:imported-modules ((guix build glib-or-gtk-build-system)
767 ,@%cmake-build-system-modules)
768 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
769 (guix build cmake-build-system)
772 (modify-phases %standard-phases
773 (add-after 'unpack 'fix-permissions-on-po-files
775 ;; Always generate translations. A recent upstream patch
777 (substitute* "po/CMakeLists.txt"
778 (("gettext_create_translations \\(\"\\$\\{potfile\\}\"\\)")
779 "gettext_create_translations (\"${potfile}\" ALL)"))
780 ;; Make sure 'msgmerge' can modify the PO files.
781 (for-each (lambda (po) (chmod po #o666))
782 (find-files "." "\\.po$"))
784 (add-after 'install 'glib-or-gtk-wrap
785 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
787 `(("cppunit" ,cppunit)
788 ("gcc" ,gcc-8) ;requires gcc 8+
789 ("gettext" ,gettext-minimal)
790 ("pkg-config" ,pkg-config)))
792 `(("alsa-lib" ,alsa-lib)
795 ("libsndfile" ,libsndfile)
798 ("lua" ,lua) ;FIXME: It cannot find the Lua library.
800 ("portaudio" ,portaudio)
801 ("texlive-bin" ,texlive-bin)))
802 (home-page "https://github.com/xournalpp/xournalpp")
803 (synopsis "Handwriting notetaking software with PDF annotation support")
804 (description "Xournal++ is a hand note taking software written in
805 C++ with the target of flexibility, functionality and speed. Stroke
806 recognizer and other parts are based on Xournal code.
811 @item Support for Pen pressure, e.g., Wacom Tablet
812 @item Support for annotating PDFs
813 @item Fill shape functionality
814 @item PDF Export (with and without paper style)
815 @item PNG Export (with and without transparent background)
816 @item Allow to map different tools / colors etc. to stylus buttons /
818 @item Sidebar with Page Previews with advanced page sorting, PDF
819 Bookmarks and Layers (can be individually hidden, editing layer can be
821 @item enhanced support for image insertion
822 @item Eraser with multiple configurations
824 @item bug reporting, autosave, and auto backup tools
825 @item Customizeable toolbar, with multiple configurations, e.g., to
826 optimize toolbar for portrait / landscape
827 @item Page Template definitions
828 @item Shape drawing (line, arrow, circle, rectangle)
829 @item Shape resizing and rotation
830 @item Rotation snapping every 45 degrees
831 @item Rect snapping to grid
832 @item Audio recording and playback alongside with handwritten notes
833 @item Multi Language Support, Like English, German, Italian...
834 @item Plugins using LUA Scripting
836 (license license:gpl2+)))
838 (define-public python-reportlab
840 (name "python-reportlab")
844 (uri (pypi-uri "reportlab" version))
847 "0lf8hil9nbm74zl27l8rydxbhwnpr0pbghibsqrc9sglds9l9vw3"))))
848 (build-system python-build-system)
850 '(;; FIXME: There is one test failure, but it does not cause the
851 ;; build to fail. No time to investigate right now.
852 #:test-target "tests"))
854 `(("freetype" ,freetype)))
856 `(("python-pillow" ,python-pillow)))
857 (home-page "https://www.reportlab.com")
858 (synopsis "Python library for generating PDFs and graphics")
859 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
860 of rich PDF documents, and also creation of charts in a variety of bitmap and
862 (license license:bsd-3)))
864 (define-public python2-reportlab
865 (package-with-python2 python-reportlab))
867 (define-public impressive
874 "mirror://sourceforge/impressive/Impressive/"
875 version "/Impressive-" version ".tar.gz"))
878 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
879 (build-system python-build-system)
881 ;; TODO: Add dependency on pdftk.
882 (inputs `(("python2-pygame" ,python2-pygame)
883 ("python2-pillow" ,python2-pillow)
889 #:phases (modify-phases %standard-phases
894 (lambda* (#:key inputs outputs #:allow-other-keys)
895 ;; There's no 'setup.py' so install things manually.
896 (let* ((out (assoc-ref outputs "out"))
897 (bin (string-append out "/bin"))
898 (man1 (string-append out "/share/man/man1"))
899 (sdl (assoc-ref inputs "sdl"))
900 (xpdf (assoc-ref inputs "xpdf")))
902 (copy-file "impressive.py"
903 (string-append bin "/impressive"))
904 (wrap-program (string-append bin "/impressive")
905 `("LIBRARY_PATH" ":" prefix ;for ctypes
906 (,(string-append sdl "/lib")))
907 `("PATH" ":" prefix ;for pdftoppm
908 (,(string-append xpdf "/bin"))))
909 (install-file "impressive.1" man1)
911 (home-page "http://impressive.sourceforge.net")
912 (synopsis "PDF presentation tool with visual effects")
914 "Impressive is a tool to display PDF files that provides visual effects
915 such as smooth alpha-blended slide transitions. It provides additional tools
916 such as zooming, highlighting an area of the screen, and a tool to navigate
918 (license license:gpl2)))
924 (home-page "https://www.kraxel.org/blog/linux/fbida/")
927 (uri (string-append "https://www.kraxel.org/releases/fbida/"
928 "fbida-" version ".tar.gz"))
931 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
932 (build-system gnu-build-system)
935 (modify-phases %standard-phases
936 (add-after 'unpack 'patch-FHS-file-names
938 (substitute* "mk/Autoconf.mk"
939 (("/bin/echo") "echo")
940 (("/sbin/ldconfig -p") "echo lib")) #t))
943 #:make-flags (list "CC=gcc"
944 (string-append "prefix=" (assoc-ref %outputs "out")))))
945 (inputs `(("libjpeg" ,libjpeg-turbo)
951 ("imagemagick" ,imagemagick)
954 ("cairo-xcb" ,cairo-xcb)
955 ("freetype" ,freetype)
956 ("fontconfig" ,fontconfig)
959 ("libepoxy" ,libepoxy)
961 ("poppler" ,poppler)))
962 (native-inputs `(("pkg-config" ,pkg-config)))
963 (synopsis "Framebuffer and drm-based image viewer")
965 "fbida contains a few applications for viewing and editing images on
968 (license license:gpl2+)))
970 (define-public pdf2svg
977 (url "https://github.com/dawbarton/pdf2svg.git")
978 (commit (string-append "v" version))))
979 (file-name (git-file-name name version))
982 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
983 (build-system gnu-build-system)
986 ("poppler" ,poppler)))
988 `(("pkg-config" ,pkg-config)))
989 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
990 (synopsis "PDF to SVG converter")
991 (description "@command{pdf2svg} is a simple command-line PDF to SVG
992 converter using the Poppler and Cairo libraries.")
993 (license license:gpl2+)))
995 (define-public python-pypdf2
997 (name "python-pypdf2")
1001 (uri (pypi-uri "PyPDF2" version))
1004 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
1005 (build-system python-build-system)
1008 (modify-phases %standard-phases
1010 'unpack 'patch-test-suite
1012 ;; The text-file needs to be opened in binary mode for Python 3,
1013 ;; so patch in the "b"
1014 (substitute* "Tests/tests.py"
1015 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
1016 (string-append line "b")))
1020 (invoke "python" "-m" "unittest" "Tests.tests"))))))
1021 (home-page "http://mstamy2.github.com/PyPDF2")
1022 (synopsis "Pure Python PDF toolkit")
1023 (description "PyPDF2 is a pure Python PDF library capable of:
1026 @item extracting document information (title, author, …)
1027 @item splitting documents page by page
1028 @item merging documents page by page
1029 @item cropping pages
1030 @item merging multiple pages into a single page
1031 @item encrypting and decrypting PDF files
1034 By being pure Python, it should run on any Python platform without any
1035 dependencies on external libraries. It can also work entirely on
1036 @code{StringIO} objects rather than file streams, allowing for PDF
1037 manipulation in memory. It is therefore a useful tool for websites that
1038 manage or manipulate PDFs.")
1039 (license license:bsd-3)))
1041 (define-public python2-pypdf2
1042 (package-with-python2 python-pypdf2))
1044 (define-public python2-pypdf
1046 (name "python2-pypdf")
1050 (uri (pypi-uri "pyPdf" version))
1053 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
1054 (build-system python-build-system)
1056 `(#:tests? #f ; no tests
1057 #:python ,python-2))
1058 (home-page "http://pybrary.net/pyPdf/")
1059 (synopsis "Pure Python PDF toolkit")
1060 (description "PyPDF2 is a pure Python PDF toolkit.
1062 Note: This module isn't maintained anymore. For new projects please use
1063 python-pypdf2 instead.")
1064 (license license:bsd-3)))
1066 (define-public pdfarranger
1068 (name "pdfarranger")
1074 (url "https://github.com/jeromerobert/pdfarranger.git")
1076 (file-name (git-file-name name version))
1078 (base32 "1f8m8r81322i97wkqpmf7a4kiwnq244n6cnbldh03jc49vwq2kxx"))))
1079 (build-system python-build-system)
1081 '(#:tests? #f ;no tests
1082 #:phases (modify-phases %standard-phases
1083 (add-after 'install 'wrap-for-typelib
1084 (lambda* (#:key inputs outputs #:allow-other-keys)
1085 (let* ((out (assoc-ref outputs "out"))
1086 (program (string-append out "/bin/pdfarranger")))
1087 (wrap-program program
1088 `("GI_TYPELIB_PATH" ":" prefix
1089 (,(getenv "GI_TYPELIB_PATH"))))
1092 `(("intltool" ,intltool)
1093 ("python-distutils-extra" ,python-distutils-extra)))
1096 ("poppler" ,poppler)
1097 ("python-pycairo" ,python-pycairo)
1098 ("python-pygobject" ,python-pygobject)
1099 ("python-pypdf2" ,python-pypdf2)))
1100 (home-page "https://github.com/jeromerobert/pdfarranger")
1101 (synopsis "Merge, split and re-arrange pages from PDF documents")
1103 "PDF Arranger is a small application which allows one to merge or split
1104 PDF documents and rotate, crop and rearrange their pages using an interactive
1105 and intuitive graphical interface.
1107 PDF Arranger was formerly known as PDF-Shuffler.")
1108 (license license:gpl3+)))
1110 (define-public pdfposter
1113 (version "0.7.post1")
1116 (uri (pypi-uri "pdftools.pdfposter" version))
1119 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
1120 (build-system python-build-system)
1122 `(#:tests? #f)) ; test-suite not included in source archive
1124 `(("python-pypdf2" ,python-pypdf2)))
1125 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1126 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1127 (description "@command{pdfposter} can be used to create a large poster by
1128 building it from multiple pages and/or printing it on large media. It expects
1129 as input a PDF file, normally printing on a single page. The output is again
1130 a PDF file, maybe containing multiple pages together building the poster. The
1131 input page will be scaled to obtain the desired size.
1133 This is much like @command{poster} does for Postscript files, but working with
1134 PDF. Since sometimes @command{poster} does not like your files converted from
1135 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1136 (license license:gpl3+)))
1138 (define-public pdfgrep
1145 (uri (string-append "https://pdfgrep.org/download/"
1146 name "-" version ".tar.gz"))
1149 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
1150 (build-system gnu-build-system)
1152 `(("pkg-config" ,pkg-config)))
1154 `(("libgcrypt" ,libgcrypt)
1156 ("poppler" ,poppler)))
1157 (home-page "https://pdfgrep.org")
1158 (synopsis "Command-line utility to search text in PDF files")
1160 "Pdfgrep searches in pdf files for strings matching a regular expression.
1161 Support some GNU grep options as file name output, page number output,
1162 optional case insensitivity, count occurrences, color highlights and search in
1164 (license license:gpl2+)))
1166 (define-public pdfpc
1174 (url "https://github.com/pdfpc/pdfpc.git")
1175 (commit (string-append "v" version))))
1176 (file-name (git-file-name name version))
1178 (base32 "07aafsm4jzdgpahz83p0ajv40hry7gviyadqi13ahr8xdhhwy2sd"))))
1179 (build-system cmake-build-system)
1180 (arguments '(#:tests? #f)) ; no test target
1184 ("gstreamer" ,gstreamer)
1185 ("gst-plugins-base" ,gst-plugins-base)
1187 ("poppler" ,poppler)
1191 `(("pkg-config" ,pkg-config)))
1192 (home-page "https://pdfpc.github.io/")
1193 (synopsis "Presenter console with multi-monitor support for PDF files")
1195 "pdfpc is a presentation viewer application which uses multi-monitor
1196 output to provide meta information to the speaker during the presentation. It
1197 is able to show a normal presentation window on one screen, while showing a
1198 more sophisticated overview on the other one providing information like a
1199 picture of the next slide, as well as the left over time till the end of the
1200 presentation. The input files processed by pdfpc are PDF documents.")
1201 (license license:gpl2+)))
1210 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1211 version "/paps-" version ".tar.gz"))
1213 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1214 (build-system gnu-build-system)
1216 `(("pango" ,pango)))
1218 `(("intltool" ,intltool)
1219 ("pkg-config" ,pkg-config)))
1220 (home-page "https://github.com/dov/paps")
1221 (synopsis "Pango to PostScript converter")
1223 "Paps reads a UTF-8 encoded file and generates a PostScript language
1224 rendering of the file. The rendering is done by creating outline curves
1225 through the Pango @code{ft2} backend.")
1226 (license license:lgpl2.0+)))
1228 (define-public stapler
1236 (url "https://github.com/hellerbarde/stapler")
1238 (file-name (git-file-name name version))
1241 "06w7xanzr7cicqik62g7zqs57j4y6fc7hflrc1rlmphxx40hkg6r"))))
1242 (build-system python-build-system)
1244 `(("python2-pypdf2" ,python2-pypdf2)))
1246 `(#:python ,python-2
1248 (modify-phases %standard-phases
1249 (add-after 'unpack 'fix-pypdf-version-requirement
1250 ;; A PyPDF2 version requirement of 1.25.1 is hard-coded in
1251 ;; setup.py. Relax it to work with any version of PyPDF2.
1253 (substitute* "setup.py"
1254 (("PyPDF2==1.25.1") "PyPDF2"))
1256 (home-page "https://github.com/hellerbarde/stapler")
1257 (synopsis "PDF manipulation tool")
1258 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1259 manipulating PDF documents from the command line. It supports
1262 @item cherry-picking pages and concatenating them into a new file
1263 @item splitting a PDF document into single pages each in its own file
1264 @item merging PDF documents with their pages interleaved
1265 @item displaying metadata in a PDF document
1266 @item displaying the mapping between logical and physical page numbers
1268 (license license:bsd-3)))
1270 (define-public weasyprint
1277 (uri (pypi-uri "WeasyPrint" version))
1279 (base32 "0skdzwq7cd715dnnds6abx0k0xmmnmsqp0vb1r1w20sg7abp3sdk"))
1280 (patches (search-patches "weasyprint-library-paths.patch"))))
1281 (build-system python-build-system)
1284 (modify-phases %standard-phases
1285 (add-after 'unpack 'patch-library-paths
1286 (lambda* (#:key inputs #:allow-other-keys)
1287 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1288 (glib (assoc-ref inputs "glib"))
1289 (pango (assoc-ref inputs "pango"))
1290 (pangoft2 (assoc-ref inputs "pangoft2")))
1291 (substitute* "weasyprint/fonts.py"
1293 (string-append fontconfig "/lib/libfontconfig.so"))
1295 (string-append pango "/lib/libpangoft2-1.0.so")))
1296 (substitute* "weasyprint/text.py"
1298 (string-append glib "/lib/libgobject-2.0.so"))
1300 (string-append pango "/lib/libpango-1.0.so"))
1302 (string-append pango "/lib/libpangocairo-1.0.so"))))))
1303 (add-after 'unpack 'remove-pytest-options
1305 (substitute* "setup.cfg"
1306 ;; flake8 and isort syntax checks fail, which is not our
1308 (("addopts = --flake8 --isort") ""))))
1311 ;; Run pytest, excluding one failing test.
1312 (invoke "pytest" "-k" "not test_flex_column_wrap_reverse"))))))
1314 `(("fontconfig" ,fontconfig)
1318 `(("gdk-pixbuf" ,gdk-pixbuf)
1319 ("python-cairocffi" ,python-cairocffi)
1320 ("python-cairosvg" ,python-cairosvg)
1321 ("python-cffi" ,python-cffi)
1322 ("python-cssselect2" ,python-cssselect2)
1323 ("python-html5lib" ,python-html5lib)
1324 ("python-pyphen" ,python-pyphen)
1325 ("python-tinycss2" ,python-tinycss2)))
1327 `(("python-pytest-cov" ,python-pytest-cov)
1328 ("python-pytest-runner" ,python-pytest-runner)))
1329 (home-page "https://weasyprint.org/")
1330 (synopsis "Document factory for creating PDF files from HTML")
1331 (description "WeasyPrint helps web developers to create PDF documents. It
1332 turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1335 From a technical point of view, WeasyPrint is a visual rendering engine for
1336 HTML and CSS that can export to PDF and PNG. It aims to support web standards
1339 It is based on various libraries but not on a full rendering engine like
1340 WebKit or Gecko. The CSS layout engine is written in Python, designed for
1341 pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1344 Keywords: html2pdf, htmltopdf")
1345 (license license:bsd-3)))