Tibor's Musings

Chromium and PDF

Chrome displays PDF files natively inside the browser via a closed-source libpdf library. This library is naturally not included in Chromium, the open source brother of Chrome. Can one achieve the same functionality with Chromium?

If one wants to display PDFs inline with Chromium too, one technique is to extract libpdf library from Chrome:

mkdir /tmp/xyzzy && cd /tmp/xyzzy
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
ar vx google-chrome-stable_current_amd64.deb
tar --lzma -xvf data.tar.lzma
sudo cp ./opt/google/chrome/libpdf.so /usr/lib/chromium/
cd $HOME && rm -rf /tmp/xyzzy

After a restart of Chromium, one can go to about:plugins to check whether the libpdf plugin is well recognised and enabled.

Now PDF files should get open inside the browser.

chromium