I build my own Chromium using Gentoo‘s ebuild. The problem is that Google’s great PDF plugin is not open source, so it doesn’t come with Chromium, which means I need to extract it from the binary builds of Chrome each time I upgrade. Here’s my ugly shell script for doing so:

$ cat latestlibpdf.sh 
#!/bin/sh
rm -rf /tmp/chromepdfscratch
mkdir -p /tmp/chromepdfscratch
pushd /tmp/chromepdfscratch
wget http://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
ar -x google-chrome-unstable_current_amd64.deb
tar -xJf data.tar.lzma
popd
sudo mv /tmp/chromepdfscratch/opt/google/chrome/libpdf.so /usr/lib/chromium-browser/
sudo chown root:root /usr/lib/chromium-browser/libpdf.so
sudo chmod 644 /usr/lib/chromium-browser/libpdf.so
rm -rf /tmp/chromepdfscratch
January 17, 2011 · [Print]

6 Comments to “Using libPDF with Chromium on Linux”

  1. avx says:

    Thanks, unfortunately it’s a lot of stuff to do for that little file, but well.

    What about wrapping up this stuff in another ebuild?

  2. Valen says:

    Very useful and interesting script but it does not always work. I have Chromium:

    Chromium 12.0.742.112 (Build para desarrolladores 90304) Ubuntu 11.04
    WebKit 534.30 (trunk@84325)
    V8 3.2.10.21
    Flash 10.3 r183
    Agente de usuario Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.30 (KHTML, like Gecko) Ubuntu/11.04 Chromium/12.0.742.112 Chrome/12.0.742.112 Safari/534.30
    Línea de órdenes /usr/lib/chromium-browser/chromium-browser –flag-switches-begin –flag-switches-end

    I tried the libpdf.so of the stable and unstable Chrome version. The extension is there (chrome://plugins) but any PDF will be downloaded and not shown in line. I even uninstalled Acrobat Reader 9 from my system (which, by the way provided extra stability to my chrome) but nothing happened.

    Is there any special configuration to be carried ou in Chromium after running your script?

    Thanks very much.

  3. Cristi says:

    The URL needs to use https:// now.

    But otherwise this is pretty cool, thanks!

  4. badger says:

    Works for me (with URL changed to https/), on last stable Chromium. Thanks a lot.

Leave a Reply