I'm running a fresh install of Arch Linux and if I try to view a pdf file in doc-view or pdf-view, I get the following error message:

No PNG support is available, or some conversion utility for pdf files is missing. Unable to render file. View extracted text instead

A quick web search didn't provide any leads as how to resolve this issue - actually, I don't even know what exactly the issue is.

  • Was your Emacs compiled with png-support? (i.e. linked to libpng) – asjo May 27 '16 at 17:57
  • @asjo The installation was done by pacman. How can I check whether it is linked and how can I link it to libpng, if that's not the case? – Stefan Mesken May 27 '16 at 18:18
  • You can check which libraries a binary is linked against by using the ldd(1) command. I don't know how pacman/Arch works, but I guess you need libpng-dev (or whatever the development package for libpng is called in Arch) installed, when compiling Emacs. – asjo May 27 '16 at 20:55

The two possibilities that I see based on the error message are:

  1. Emacs was not compiled with png support
  2. You do not have a program to convert from pdf to png installed

The ways to check each of these are:

  1. Try to open a png in Emacs if you see a picture in image mode (you may need to hit C-c C-c or something) then you have png support.
  2. Open a terminal and run gs. if this program is installed then you should be good. Otherwise, install Ghostscript

If you don't have png support them I don't really know what you can do easily. You may be able to find some distro specific instructions for a more complete installation or you may have to build Emacs yourself.

I should probably add that if you get docview working then you should look into pdftools as it can give you some more advanced pdf-specific features

| improve this answer | |
  • Thank you. It was ghostscript that was missing. Installing it resolved the issue. – Stefan Mesken May 28 '16 at 6:47

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.