1

When I view PDFs in Emacs using DocView, they appear much darker than they should:

Emacs and Preview displaying the same PDF, where the PDF appears much darker in Emacs

I am not sure why this happens -- I haven't changed any settings related to DocView or enabled any minor modes that would cause this. Disabling my current emacs config (by moving .emacs.d) does not resolve this. I am using the mituharu emacs-mac port from this Homebrew formula, but the issue also exists with the build from https://emacsformacosx.com. My .emacs.d is on GitHub here.

I've tried using doc-view-clear-cache and revert-buffer, but neither of these help.

Has anyone encountered a similar issue before? How would I go about resolving this?

UPDATE: This seems to be caused by GhostScript. DocView runs the following command to convert each page of a PDF into a PNG:

gs -dSAFER -dNOPAUSE -sDEVICE=png16m -dTextAlphaBits=4 -dBATCH -dGraphicsAlphaBits=4 -dQUIET -r100 -sOutputFile=out.png in.pdf

Running this command produces dark gray images like the one I see in Emacs.

1 Answer 1

0

I've resolved this issue by installing mupdf (brew install mupdf), which caused DocView to use mudraw as the PDF->PNG conversion backend instead of Ghostscript. Running doc-view-clear-cache after installing mupdf fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.