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.
At first, I referenced this page and found the KParts Plugin.
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!”
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
cmake . gets through, type
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
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 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
$ 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
Then do something like:
$ cp /tmp/google-chrome-stable_current_i386/opt/
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.