Doc-view-mode after OS X upgrade
I recently updated OS X and now my Emacs installation cannot open PDF files. I am getting the error
No PNG support is available, or some conversion utility for pdf files is missing.
when trying to switch to doc-view in PDF format. This worked before the update, but now I can't figure out what happened. I made sure that xpdf and ghostscript are installed via brew.
Does anyone know how to fix this?
source to share
Most likely, the values โโof $PATH
or changed during OSX upgrade exec-path
. I personally like to use absolute paths for executables, but you can also customize any of the above values. Below is an example for OSX, Window XP and Windows 7 - the location of the executable program depends on where it was installed:
(setq doc-view-ghostscript-program (cond ((eq system-type 'darwin) "/Users/HOME/.0.data/.0.emacs/bin/gs") ((and (eq system-type 'windows-nt) (equal (w32-version) '(5 1 2600))) "c:/Program Files/gs/gs9.14/bin/gswin32c.exe") ((and (eq system-type 'windows-nt) (equal (w32-version) '(6 1 7601))) "c:/Program Files/gs/gs9.14/bin/gswin32c.exe")))
The following command can be used to view the current $PATH
Emacs in use:
M-x eval-expression RET (getenv "PATH") RET
After locating "gs", the original poster can add it to Emacs $PATH
if needed - for example,
(setenv "PATH" (concat (getenv "PATH") ":/path/to/folder-containing-gs"))
I'll let another forum member handle the example exec-path
, as I'm not using it right now, but here's my notes - that's unverified.
(setq exec-path (append exec-path '("/path/to/folder-containing-gs")))
source to share