doomemacs/modules/tools/pdf
Henrik Lissner 1f8bf7accb
merge: rewrite-docs
I've omitted docs/*.org from this merge, as there is still work left to
do there, but I am pushing the module docs early so folks can benefit
from the new docs sooner.
2022-08-03 03:27:50 +02:00
..
config.el refactor(pdf): better epdfinfo check on pdf-view-mode 2022-07-24 13:16:02 +02:00
packages.el bump: :tools pdf 2022-07-24 13:16:02 +02:00
README.org fix(docs): set mode in file-local vars 2022-08-03 02:46:33 +02:00

:tools pdf

Description   unfold

This module improves support for reading and interacting with PDF files in Emacs.

It uses pdf-tools, which is a replacement for the built-in doc-view-mode for PDF files. The key difference being pages are not pre-rendered, but instead rendered on-demand and stored in memory; a much faster approach, especially for larger PDFs.

Displaying PDF files is just one function of pdf-tools. See its project website for details and videos.

Maintainers

This module has no dedicated maintainers. Become a maintainer?

Module flags

This module has no flags.

TODO Hacks

🔨 This module's hacks haven't been documented yet. Document them?

TODO Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

This module requires epdfinfo, a program the the pdf-tools plugin will build automatically when you open your first pdf file, unless you're on Windows. Windows users must build it themselves.

You can (re)build epdfinfo yourself with M-x pdf-tools-install.

Building epdfinfo on Windows

  1. Install MSYS2 and update the package database and core packages using the instructions provided.
  2. Update and install dependencies, skipping any you already have:

    pacman -Syu
    pacman -S base-devel
    pacman -S mingw-w64-x86_64-toolchain
    pacman -S mingw-w64-x86_64-zlib
    pacman -S mingw-w64-x86_64-libpng
    pacman -S mingw-w64-x86_64-poppler
    pacman -S mingw-w64-x86_64-imagemagick
  3. Install PDF tools in Emacs, but do not try to compile the server. Instead, get a separate copy of the source somewhere else:

    git clone https://github.com/politza/pdf-tools
  4. Open mingw64 shell (Note: You must use mingw64.exe and not msys2.exe)
  5. Compile pdf-tools:

    # Cask requires python2 (important: not 3!)
    pacman -S python2
    
    # Make the mingw-shell aware of your python installation. Adjust the path if
    # Emacs is installed elsewhere!
    export PATH="/c/Program Files (x86)/Emacs/bin/:$PATH"
    
    # Cask needs to know where git.exe is; change this path if git is installed
    # elsewhere!
    export PATH="/c/Program Files/Git/bin:$PATH"
    
    # Install cask. Certificate errors can be ignored with (unsafe) -k option.
    curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python
    
    # Make sure the build process can see cask
    export PATH="$HOME/.cask/bin:$PATH"
    
    cd /path/to/pdf-tools
    make -s
  6. This should produce a file server/epdfinfo.exe. Copy this file into the $HOME/.emacs.d/.local/straight/build/pdf-tools/.
  7. Start Emacs.
  8. Open a pdf file (or run M-x pdf-tools-install)
  9. Test it out: M-x pdf-info-check-epdfinfo

TODO Usage

🔨 This module has no usage documentation yet. Write some?

TODO Configuration

🔨 This module has no configuration documentation yet. Write some?

Troubleshooting

There are no known problems with this module. Report one?

Frequently asked questions

This module has no FAQs yet. Ask one?

TODO Appendix

🔨 This module has no appendix yet. Write one?