Click here to Skip to main content
11,576,635 members (58,633 online)
Click here to Skip to main content

Tagged as

Enable PDF viewing in Chromium

, 13 Aug 2011 CC (ASA 3U) 20.8K 1
Rate this:
Please Sign up or sign in to vote.
Enable PDF viewing in Chromium

Prior to today, I have been using acroread to view PDF files in Chromium, which is embedded through MozPlugger and some tricks. However, it will open up a new window sometimes and it’s always slow. This article will enable PDF viewing in Chromium using two methods.

KParts Plugin

At first, I referenced this page and found the KParts Plugin.

I wget the source code tarball, uncompress it, and type cmake . in my terminal according to the README.txt. It checks for dependencies and reports an error “Qt qmake not found!”

Type qmake directly in the terminal and it runs, so it is actually reachable buy CMake cannot find it. After some searches, I finally found this bug in Launchpad: “[Natty] CMake: FindQt4 doesn’t work if qt3-dev-tools are installed”.

The only work-around is to apt-get remove qt3-dev-tools.

cmake . again and I get another error reported saying “cmake/modules/FindKDE4Internal.cmake not found”. It is resolved in this post, which also provides some useful techniques like apt-file search.

After cmake . gets through, type make and sudo make install. KParts Plugin will be installed at /usr/lib/nsbrowser/plugins/ in my laptop. Then just:

$ sudo cp /usr/lib/nsbrowser/plugins/libkpartsplugin.so 
/usr/lib/chromium-browser/plugin/

Now you can view PDF files in Chromium and KParts Plugin works perfectly. However, there is always a bar on the top of the embedded Okular.

Chrome’s libpdf.so

Chrome has native support for PDF files but it is not available officially in Chromium. You may wget one of the following packages, uncompress it, and find libpdf.so in opt/google/chrome/.

$ wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_i386.deb
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-unstable_current_i386.deb
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb

In my laptop (Chromium 13.0.782.109, Ubuntu 11.04), I have to use package google-chrome-stable_current_i386.deb.

Then do something like:

$ cp /tmp/google-chrome-stable_current_i386/opt/
google/chrome/libpdf.so /usr/lib/chromium-browser/

You may have to try both the stable and the unstable releases and copy the file libpdf.so to your Chromium installation directory, and navigate to about:plugins to enable Chrome PDF Viewer.

Now you should get the PDF viewer working perfectly in Chromium, exactly the same as in Google Chrome.

License

This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-Share Alike 3.0 Unported License

Share

About the Author

stfairy
Student Shanghai Jiao Tong University
China China
No Biography provided

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150603.1 | Last Updated 13 Aug 2011
Article Copyright 2011 by stfairy
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid