PDF, PS and DjVu: Difference between revisions
(create #Extract images from a PDF) |
(→Viewers: Add back the list of applications. It's much easier to overview the applications in a list, and this is the standard way on the ArchWiki.) |
||
Line 18: | Line 18: | ||
{{Note|Some [[web browser]]s can display PDF files, for example with [[Browser plugins#PDF.js|PDF.js]].}} | {{Note|Some [[web browser]]s can display PDF files, for example with [[Browser plugins#PDF.js|PDF.js]].}} | ||
* {{App|[[Wikipedia:Adobe Reader|Adobe Reader]]|Proprietary PDF file viewer offered by Adobe. Discontinued for Linux.|http://www.adobe.com/products/reader.html|{{AUR|acroread}}}} | |||
* {{App|apvlv|Lightweight document viewer with [[Vim]] keybindings. Supports PDF, DjVu, UMD and TXT.|https://naihe2010.github.io/apvlv/|{{AUR|apvlv}}}} | |||
* {{App|Atril|Simple multi-page document viewer for MATE. Supports DjVu, DVI, EPS, EPUB, PDF, PostScript, TIFF, XPS and Comicbook.|https://github.com/mate-desktop/atril|{{Pkg|atril}}}} | |||
* {{App|DjView|Viewer for DjVu documents.|http://djvu.sourceforge.net/djview4.html|{{Pkg|djview}}}} | |||
* {{App|ePDFView|Lightweight PDF document viewer using the Poppler and GTK+ libraries. Development stopped.|http://freecode.com/projects/epdfview|{{Pkg|epdfview}}}} | |||
* {{App|[[Emacs]]|See also [https://github.com/politza/pdf-tools pdf-tools] for improved pdf support and the [https://elpa.gnu.org/packages/djvu.html djvu package] for djvu support.|https://www.gnu.org/software/emacs/|{{Pkg|emacs}}}} | |||
* {{App|[[Wikipedia:Evince|Evince]]|Document viewer for GNOME. Supports DjVu, DVI, EPS, PDF, PostScript, TIFF, XPS and Comicbook.|https://wiki.gnome.org/Apps/Evince|{{Pkg|evince}}}} | |||
* {{App|[[Wikipedia:Foxit Reader|Foxit Reader]]|Small, fast (compared to Acrobat) proprietary PDF viewer.|https://www.foxitsoftware.com/pdf-reader/|{{AUR|foxitreader}}}} | |||
* {{App|gv|Graphical user interface for the Ghostscript interpreter that allows to view and navigate through PostScript and PDF documents.|https://www.gnu.org/software/gv/|{{Pkg|gv}}}} | |||
* {{App|[[llpp]]|Very fast PDF reader based off of MuPDF, that supports continuous page scrolling, bookmarking, and text search through the whole document.|http://repo.or.cz/w/llpp.git|{{Pkg|llpp}}}} | |||
* {{App|[[MuPDF]]|Very fast EPUB, FictionBook, PDF, XPS and Comicbook viewer written in portable C. Features CJK font support.|https://mupdf.com/|{{Pkg|mupdf}}}} | |||
* {{App|[[Wikipedia:Okular|Okular]]|Universal document viewer for KDE. Supports CHM, Comicbook, DjVu, DVI, EPUB, FictionBook, Mobipocket, ODT, PDF, Plucker, PostScript, TIFF and XPS.|https://okular.kde.org/|{{Pkg|okular}}}} | |||
* {{App|pdfpc|Presenter console with multi-monitor support for PDF files.|https://pdfpc.github.io/|{{Pkg|pdfpc}}}} | |||
* {{App|qpdfview|Tabbed document viewer. It uses Poppler for PDF support, libspectre for PS support, DjVuLibre for DjVu support, CUPS for printing support and the Qt toolkit for its interface.|https://launchpad.net/qpdfview|{{Pkg|qpdfview}}}} | |||
* {{App|[[Wikipedia:Xpdf|Xpdf]]|Viewer that can decode LZW and read encrypted PDFs.|http://www.xpdfreader.com/|{{Pkg|xpdf}}}} | |||
* {{App|Xreader|Document viewer part of the X-Apps Project. Supports DjVu, DVI, EPUB, PDF, PostScript, TIFF, XPS, Comicbook.|https://github.com/linuxmint/xreader/|{{Pkg|xreader}}}} | |||
* {{App|[[Zathura]]|Highly customizable and functional document viewer (plugin based). Supports PDF, DjVu, PostScript and Comicbook.|https://pwmt.org/projects/zathura/|{{Pkg|zathura}}}} | |||
=== Compairson === | |||
{{Accuracy|Filling out PDF forms seem to be broken in MuPDF and llpp.}} | {{Accuracy|Filling out PDF forms seem to be broken in MuPDF and llpp.}} | ||
{| class="wikitable sortable" style="text-align:center;" | {| class="wikitable sortable" style="text-align:center;" | ||
! Name | ! Name !! PDF !! PostScript !! DjVu !! PDF forms !! License | ||
|- | |- | ||
| [https://naihe2010.github.io/apvlv/ apvlv] | | [https://naihe2010.github.io/apvlv/ apvlv] || Poppler || {{Na}} || DjVuLibre || {{Na}} || {{B|GPLv2}} | ||
|- | |- | ||
| [https://github.com/mate-desktop/atril Atril] | | [https://github.com/mate-desktop/atril Atril] || Poppler || libspectre || DjVuLibre || {{Ya}} || {{B|GPLv2}} | ||
|- | |- | ||
| [http://djvu.sourceforge.net/djview4.html DjView] | | [http://djvu.sourceforge.net/djview4.html DjView] || {{Na}} || {{Na}} || DjVuLibre || {{Ya}} || {{B|GPLv2}} | ||
|- | |- | ||
| [[Emacs]] | | [[Emacs]] || colspan=2 |Ghostscript* || DjVuLibre* || {{Na}} || {{B|GPLv3}} | ||
|- | |- | ||
| [[Wikipedia:Evince|Evince]] | | [[Wikipedia:Evince|Evince]] || Poppler || libspectre || DjVuLibre || {{Ya}} || {{B|GPLv2}} | ||
|- | |- | ||
| [[Wikipedia:Foxit Reader|Foxit Reader]] | | [[Wikipedia:Foxit Reader|Foxit Reader]] || custom || {{Na}} || {{Na}} || {{Ya}} || {{V|proprietary}} | ||
|- | |- | ||
| [https://www.gnu.org/software/gv/ gv] | | [https://www.gnu.org/software/gv/ gv] || colspan=2 |Ghostscript || {{Na}} || {{Na}} || {{B|GPLv3}} | ||
|- | |- | ||
| [[llpp]] | | [[llpp]] || libmupdf || {{Na}} || {{Na}} || {{Ya}} || {{B|GPLv3}} | ||
|- | |- | ||
| [[MuPDF]] | | [[MuPDF]] || custom || {{Na}} || {{Na}} || {{Ya}} || {{B|AGPLv3}} | ||
|- | |- | ||
| [[Wikipedia:Okular|Okular]] | | [[Wikipedia:Okular|Okular]] || Poppler || libspectre || DjVuLibre || {{Ya}} || {{B|GPL, LGPL}} | ||
|- | |- | ||
| [https://pdfpc.github.io/ pdfpc] | | [https://pdfpc.github.io/ pdfpc] || Poppler || {{Na}} || {{Na}} || {{Na}} || {{B|GPLv2}} | ||
|- | |- | ||
| [https://launchpad.net/qpdfview qpdfview] | | [https://launchpad.net/qpdfview qpdfview] || Poppler || libspectre* || DjVuLibre* || {{Ya}} || {{B|GPLv2}} | ||
|- | |- | ||
| [[Wikipedia:Xpdf|Xpdf]] | | [[Wikipedia:Xpdf|Xpdf]] || custom || {{Na}} || {{Na}} || {{Na}} || {{B|GPLv3}} | ||
|- | |- | ||
| [https://github.com/linuxmint/xreader/ Xreader] | | [https://github.com/linuxmint/xreader/ Xreader] || Poppler || libspectre* || DjVuLibre* || {{Ya}} || {{B|GPLv2}} | ||
|- | |- | ||
| [[Zathura]] | | [[Zathura]] || Poppler* / libmupdf* || libspectre* || DjVuLibre* || {{Ya}} || {{B|zlib}} | ||
|} | |} | ||
Line 62: | Line 82: | ||
The proprietary and deprecated [[Wikipedia:PDF#Adobe XML Forms Architecture (XFA)|XFA]] format for forms, is not fully support by Poppler[https://gitlab.freedesktop.org/poppler/poppler/issues/199][https://gitlab.freedesktop.org/poppler/poppler/issues/530] and only supported by [[#Discontinued|Adobe Reader]] and [[#Advanced editors|Master PDF Editor]]. | The proprietary and deprecated [[Wikipedia:PDF#Adobe XML Forms Architecture (XFA)|XFA]] format for forms, is not fully support by Poppler[https://gitlab.freedesktop.org/poppler/poppler/issues/199][https://gitlab.freedesktop.org/poppler/poppler/issues/530] and only supported by [[#Discontinued|Adobe Reader]] and [[#Advanced editors|Master PDF Editor]]. | ||
=== Framebuffer === | === Framebuffer === |
Revision as of 00:41, 12 December 2018
This article covers software to view, edit and convert PDF, PostScript (PS) and DjVu (déjà vu) files.
Engines
Poppler (poppler) is a PDF rendering library based on Xpdf. For CJK (Chinese, Japanese, Korean) support with Poppler, install poppler-data.
libspectre (libspectre) is a small library for rendering Postscript documents.
Ghostscript (ghostscript) is an interpreter for PostScript and PDF.
DjVuLibre (djvulibre) is a suite to create, manipulate and view DjVu documents.
Viewers
- Adobe Reader — Proprietary PDF file viewer offered by Adobe. Discontinued for Linux.
- apvlv — Lightweight document viewer with Vim keybindings. Supports PDF, DjVu, UMD and TXT.
- Atril — Simple multi-page document viewer for MATE. Supports DjVu, DVI, EPS, EPUB, PDF, PostScript, TIFF, XPS and Comicbook.
- DjView — Viewer for DjVu documents.
- ePDFView — Lightweight PDF document viewer using the Poppler and GTK+ libraries. Development stopped.
- Emacs — See also pdf-tools for improved pdf support and the djvu package for djvu support.
- Evince — Document viewer for GNOME. Supports DjVu, DVI, EPS, PDF, PostScript, TIFF, XPS and Comicbook.
- Foxit Reader — Small, fast (compared to Acrobat) proprietary PDF viewer.
- gv — Graphical user interface for the Ghostscript interpreter that allows to view and navigate through PostScript and PDF documents.
- llpp — Very fast PDF reader based off of MuPDF, that supports continuous page scrolling, bookmarking, and text search through the whole document.
- MuPDF — Very fast EPUB, FictionBook, PDF, XPS and Comicbook viewer written in portable C. Features CJK font support.
- Okular — Universal document viewer for KDE. Supports CHM, Comicbook, DjVu, DVI, EPUB, FictionBook, Mobipocket, ODT, PDF, Plucker, PostScript, TIFF and XPS.
- pdfpc — Presenter console with multi-monitor support for PDF files.
- qpdfview — Tabbed document viewer. It uses Poppler for PDF support, libspectre for PS support, DjVuLibre for DjVu support, CUPS for printing support and the Qt toolkit for its interface.
- Xpdf — Viewer that can decode LZW and read encrypted PDFs.
- Xreader — Document viewer part of the X-Apps Project. Supports DjVu, DVI, EPUB, PDF, PostScript, TIFF, XPS, Comicbook.
- Zathura — Highly customizable and functional document viewer (plugin based). Supports PDF, DjVu, PostScript and Comicbook.
Compairson
Name | PostScript | DjVu | PDF forms | License | |
---|---|---|---|---|---|
apvlv | Poppler | Template:Na | DjVuLibre | Template:Na | GPLv2 |
Atril | Poppler | libspectre | DjVuLibre | Template:Ya | GPLv2 |
DjView | Template:Na | Template:Na | DjVuLibre | Template:Ya | GPLv2 |
Emacs | Ghostscript* | DjVuLibre* | Template:Na | GPLv3 | |
Evince | Poppler | libspectre | DjVuLibre | Template:Ya | GPLv2 |
Foxit Reader | custom | Template:Na | Template:Na | Template:Ya | proprietary |
gv | Ghostscript | Template:Na | Template:Na | GPLv3 | |
llpp | libmupdf | Template:Na | Template:Na | Template:Ya | GPLv3 |
MuPDF | custom | Template:Na | Template:Na | Template:Ya | AGPLv3 |
Okular | Poppler | libspectre | DjVuLibre | Template:Ya | GPL, LGPL |
pdfpc | Poppler | Template:Na | Template:Na | Template:Na | GPLv2 |
qpdfview | Poppler | libspectre* | DjVuLibre* | Template:Ya | GPLv2 |
Xpdf | custom | Template:Na | Template:Na | Template:Na | GPLv3 |
Xreader | Poppler | libspectre* | DjVuLibre* | Template:Ya | GPLv2 |
Zathura | Poppler* / libmupdf* | libspectre* | DjVuLibre* | Template:Ya | zlib |
- (* means optional)
PDF forms
The PDF forms column in the above table refers to AcroForms support. If you do not need your input to be directly extractable from the PDF, you can also use the applications in #Annotation or #Graphical PDF editing to put text on top of a PDF. PDF forms can be created with LibreOffice Writer (View > Toolbars > Form Controls) and the advanced PDF editors.
The proprietary and deprecated XFA format for forms, is not fully support by Poppler[1][2] and only supported by Adobe Reader and Master PDF Editor.
Framebuffer
- fbgs — Poor man's PostScript/pdf viewer for the linux framebuffer console.
- fbpdf — Small framebuffer PDF and DjVu viewer based off of MuPDF, with Vim keybindings and written in C
- JFBView — Framebuffer PDF and image viewer. Features include Vim-like controls, zoom-to-fit, a TOC (outline) view, fast multi-threaded rendering and asynchronous pre-caching. Originally a fork of fbpdf called jfbpdf, now completely rewritten.
Annotation
- flpsed — A PostScript and PDF annotator, only supports text boxes.
See also List of applications/Documents#Stylus note-taking.
Graphical PDF editing
- Scribus can import and export PDF; text is imported as polygons.[3]
- LibreOffice Draw can import and export PDF; text is imported as text; embedded fonts are substituted.[4][5]
- Inkscape can import a single page from a PDF and export to PDF; text is imported as cloned glyphs or text; with the latter embedded fonts are substituted.
- Graphics editors like GIMP and krita can also import and export PDFs at the cost of rasterization.
Simple editors
- PDF Chain — GTK front-end for PDFtk, written in C++, supporting concatenation, burst, watermarks, attaching files and more.
- PDF Mix Tool — Qt front-end for PoDoFo, written in C++, supports splitting, merging, rotating and mixing PDF files.
- PDF Mod — Reorder, rotate, and remove pages, export images from a document, edit the title, subject, author, and keywords, and combine documents via drag and drop.
- PDF-Shuffler — GTK2 front-end for pyPdf, written in Python, supports concatenation, splitting, rotation and reordering.
Advanced editors
- Master PDF Editor — Functional proprietary PDF editor. Free for non-commercial use.
- https://code-industry.net/free-pdf-editor/ || masterpdfeditorAUR, masterpdfeditor-qt4AUR for older version without restrictions
- PDFsam — Open source application, written in Java, supports merging, splitting, rotating and some premium features.
- PDF Studio — All-in-one proprietary PDF editor similar to Adobe Acrobat.
Command-line tools
- PDFtk — Simple tool for doing everyday things with PDF documents
- http://www.pdfhacks.com/pdftk || pdftkAUR, pdftk-binAUR
- Stapler — Light alternative to PDFtk using the PyPDF2 library.
- QPDF — Content-preserving PDF transformation system.
- pdfgrep — Commandline utility to search text in PDF files.
- pdf2svg — Convert PDF files to SVG files.
- mupdf-tools — Tools developed as part of MuPDF, contains mutool(1) and muraster.
- gs(1) from Ghostscript, see also
/usr/share/doc/ghostscript/*/Use.htm
(online). Ghostscript also provides many wrapper scripts like ps2pdf and pdf2ps.
DjVu tools
- DjVuLibre provides many command-line tools, like ddjvu(1) for example.
- pdf2djvu — Creates DjVu files from PDF files.
- img2djvu — Single-pass DjVu encoder based on DjVu Libre and ImageMagick
Create a PDF from images
With GraphicsMagick:
$ gm convert one.jpg two.jpg three.jpg out.pdf
Extract images from a PDF
With Poppler to JPEG:
$ pdfimages infile.pdf -j outfileroot
Inspecting metadata
With Poppler:
$ pdfinfo file.pdf
With ExifTool:
$ exiftool file.pdf
Optimize a PDF
With Ghostscript:
$ ps2pdf -dPDFSETTINGS=/screen in.pdf out.pdf
For different settings see the documentation.
There is also shrinkpdfAUR, a third-party wrapper script.
Encrypt a PDF
The user password is used for encryption, the owner password to restrict operations once the document is decrypted, for more information, see Wikipedia:PDF#Security and signatures.
With PDFtk:
$ pdftk in.pdf output out.pdf user_pw password
With PoDoFo:
$ podofoencrypt -u user_password -o owner_password in.pdf out.pdf
With QPDF:
$ qpdf --encrypt user_password owner_password key_length -- in.pdf out.pdf
where key_length
can be 40, 128 or 256.
Decrypt a PDF
This section lists commands to decrypt a PDF to an unencrypted file. Note that most PDF viewers also support encrypted PDFs.
With PDFtk:
$ pdftk in.pdf input_pw password output out.pdf
With QPDF:
$ qpdf --decrypt --password=password in.pdf out.pdf
With Poppler to PostScript:
$ pdftops -upw password in.pdf out.ps
Concatenate PDFs
With PDFtk:
$ pdftk one.pdf two.pdf three.pdf cat output out.pdf
With Poppler:
$ pdfunite one.pdf two.pdf three.pdf out.pdf
With QPDF:
$ qpdf --empty --pages one.pdf two.pdf three.pdf -- out.pdf
Extract page range from PDF
With PDFtk as a single file:
$ pdftk infile.pdf cat first-last output outfile.pdf
With Poppler as separate files:
$ pdfseparate -f first -l last infile.pdf outfileroot-%d.pdf
With QPDF as a single file:
$ qpdf --empty --pages infile.pdf first-last -- outfile.pdf
Rasterize a PDF
With GraphicsMagick to convert a specific page:
$ gm convert -density dpi infile.pdf[page] outfile.jpg
With Poppler to convert all pages:
$ pdftoppm -jpeg -r dpi in.pdf infile.pdf outfileroot
With Poppler to convert a specific page:
$ pdftoppm -jpeg -r dpi in.pdf -f page -singlefile infile.pdf outfileroot
Libraries
- libharu — C library for generating PDF documents.
- https://github.com/libharu/libharu || libharu, Lua binding: lua-hpdfAUR
- PoDoFo — A C++ library to work with the PDF file format.
Python
- pdfrw — A pure Python library that reads and writes PDFs.
- pyPdf — Discontinued predecessor of PyPDF2.
- PyPDF2 — A pure-Python library built as a PDF toolkit.
- PyX — Python library for the creation of PostScript and PDF files.
- ReportLab — A proven industry-strength PDF generating solution