Main menu

Enabling Chrome's PDF Viewer in Chromium on Linux

Submitted by kfnic on Sat, 08/03/2013 - 14:24

Here's a quick fix for something that was bugging me today in a fresh install of Xubuntu 13.04. Chromium does not install by default with a pdf viewer. Google Chrome, however, includes libpdf (a PDF reader library) by default. Below are instructions to rip this library out of a Google Chrome .deb package and install it in an existing Chromium install. The commands in this article are written for Debian based linux distributions.

To do all of this in one single action, run the command below and then open Chromium and visit about:plugins. You'll be prompted for your password once to copy the file to the correct location. This command just strings together all the commands necessary to install the library.

To see what each individual command does, see the descriptions after the break.

Next, you're going to want to extract the libpdf file from this .deb file. The location of the file you want to extract is opt/google/chrome/libpdf.so within the package. To pull out this file specifically, use the dpkg command with the --fsys-tarfile option, piped to the tar command, which reads from stdin and extracts the requested file. This command is seen below:

Now, you need to take this file you just extracted and move it to the correct directory for Chromium to pick up when you open it. This, by default, is the /usr/lib/chromium-browser/ directory. To copy the file, run the command below:

sudo cp opt/google/chrome/libpdf.so /usr/lib/chromium-browser/

Finally, before you open Chromium to enable the plugin, clean up all the extra files from your current directory:

rm -rf opt/ && rm google-chrome-stable_current_amd64.deb

Now, the next time you open up Chromium type about:plugins in the address bar, and you should see Chrome PDF Viewer on the list.