Enabling Chrome's PDF Viewer in Chromium on Linux

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. 

wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && dpkg --fsys-tarfile google-chrome-stable_current_amd64.deb | tar -xf - ./opt/google/chrome/libpdf.so && sudo cp opt/google/chrome/libpdf.so /usr/lib/chromium-browser/ && rm -rf opt/ && rm google-chrome-stable_current_amd64.deb