Installing the epdfinfo server from source on Windows (+ Gotchas)

If using the GNU binaries for Windows, support for PNG and zlib must first be installed by copying the appropriate dlls into emacs’ bin/ directory. Most third-party binaries come with this already done.

  1. install MSYS2 and update the package database and core packages using the instructions provided.
  2. Open mingw64 shell (Note: You must use mingw64.exe and not msys2.exe)
  3. Compile the epdfinfo server using Installation steps described in Installing the `epdfinfo` server
  4. This should produce a file server/epdfinfo.exe. Copy this file into the pdf-tools/ installation directory in your Emacs.
  5. Make sure Emacs can find epdfinfo.exe. Either add the MINGW install location (e.g. C:/msys2/mingw64/bin) to the system path with setx PATH "C:\msys2\mingw64\bin;%PATH%" or set Emacs’s path with (setenv "PATH" (concat "C:\\msys64\\mingw64\\bin;" (getenv "PATH"))). Note that libraries from other GNU utilities, such as Git for Windows, may interfere with those needed by pdf-tools. pdf-info-check-epdinfo will succeed, but errors occur when trying to view a PDF file. This can be fixed by ensuring that the MSYS libraries are always preferred.
  6. pdf-tools will successfully compile using Cygwin, but it will not be able to open PDFs properly due to the way binaries compiled with Cygwin handle file paths. Please use MSYS2.