embedding evince in Chrome

One of the big problems with Google Chrome is the lack of inline PDF support on most platforms. Google has added preliminary support for PDF to Chromium but so far it has not come to Linux. It may come tomorrow, but until then, users who would like to avoid using acroread may use the following hack, at least on Ubuntu Lucid. As always, your mileage may vary.

The fix is a simple tweak to the /etc/mozpluggerrc file. (edit: A comment below purports to have a superior solution...)

### Acrobat Reader
#define(ACROREAD, [repeat swallow(acroread) fill : acroread -openInNewWindow /a "$fragment" "$file"])
define(ACROREAD, [repeat swallow(evince) fill needs_xembed : evince "$file"])

The commented line is the original. The replacement is what seems to load evince with the file in a tab in chromium-daily right now on Lucid. I installed mozplugger but not acroread. You could make this change other ways; they are left as an exercise to the reader. This will prevent acrobat reader from loading even if it is installed, which some may find desirable. Keystrokes never reach the embedded application, but this will prevent you only from searching within the file. This is annoying! But at least it works, unlike the default means of loading evince via mozplugger.

Comments

Thanks for the tip!! Works with okular too (I'm also on Lucid). define(ACROREAD, [repeat swallow(okular) fill needs_xembed : okular "$file"])

Whether it is there or not probably depends on whether you've upgraded or installed to get to a recent version of ubuntu. I'll see if I can come up with a more modern edition at some point.

thanks, still works in Ubuntu 11.04 and Chromium 14. really nice would be a solution that works in /etc/mozpluggerrc.d/62-documents.conf as /etc/mozpluggerrc shouldn't be edited.

Thanks a lot, it does work after trying to find a lot of different solutions.

Got it to work with Linux Mint 13 and Chromium 20. Since i did not want to edit /etc/mozpluggerrc, i looked in /etc/mozpluggerrc.d/62-documents.conf and found out, that evince is already listed! so i ran update-mozpluggerrc, and it worked! Since i use Linux Mint with cinnamon, i had to create the file ~/.config/evince/evince_toolbar.xml with the content <?xml version="1.0"?> to get rid of the toolbar. Works fine. (The hint with the toolbar i got from http://moserei.de/2011/02/10/evince-with-tabs.html )

Add new comment

Default

  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • You may link to images on this site using a special syntax
  • Web page addresses and e-mail addresses turn into links automatically.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Filtered words will be replaced with the filtered version of the word.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <q>

Issue

  • Lines and paragraphs break automatically.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>

Drinking Game

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <p> <br> <pre> <h2> <h3> <h4>
  • Images may be embedded like: [image:node_id align=alignment hspace=n vspace=n border=n size=label width=n height=n nolink=(0|1) class=name style=style-data node=id] Leave off any attributes you don't want.
  • [img_assist|...] tags will be displayed, maybe. Please don't make more of them.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.