Auteur Sujet: Chromium and inline PDF view  (Lu 1426 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne Taco.22

  • Membre Senior
  • ****
  • Messages: 391
    • Scorpio_Openbox
Chromium and inline PDF view
« le: 17 janvier 2013 à 02:23:02 »
SETUP - P4/32bit with Debian net-install, Squeeze with statler, testing and backports enabled

Background - Chrome has a built-in PDF viewer, but Chromium doesn't.



Finally managed to get PDFs to display in Chromium.  Took a lot of messing about, but this worked for me.  Debian's stable Chromium is still only at version 6.  Enable testing and install the latest - currently version 20.  Then download the latest Chrome for your system.  We are going to extract the libpdf.so and install it into our system.


WARNING - Somewhere towards the end of this process root seems to have a habit of taking ownership of the folder you are working in.  This is really bad if it is your /home/"your name" folder!!  So copy your downloaded Chromium package to a new folder that can be thrown away at the end of the process.

So, in that folder su to root.  Then extract the .deb with
# ar vx <previously downloaded .deb>
Then extract the data payload -
# tar --lzma -xvf data.tar.lzma
We then drill down to $WORKDIR/opt/google/chrome/libpdf.so ($WORKDIR being the folder you are working in) and copy it to /usr/lib/chromium - or at least that is where the chromium folder is on my system.  You may need to check /opt if it's not in the /usr path.


Once this is done open Chromium and enter "about:plugins" in the address bar and it should be listed as "Chrome PDF Viewer".  Open a PDF file to test.


At this point you may well find that the folder with the dismembered carcase of Chrome is now owned by root.  Trash it.  If you want to keep it su to root and do -
chown -Rv your_name path/of/folder

Anyway, it worked for me in the end, and doesn't need mozplugger or acroread, both of which can really pull in some stuff!!  


What can go wrong !!!

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1743
    • Citrotux
Re : Chromium and inline PDF view
« Réponse #1 le: 24 janvier 2013 à 20:14:11 »
Hi,

A good habit is to do any temporary work in the /tmp directory, which is often default mounted on tmpfs in many distributions : temporary file system (mounted on RAM). This way not harm can occur and any files and folders which you don't need to keep will be automatically destroyed at next shutdown or reboot.

Still creating a work directory in it can be a good idea : just in case you meet with a "tar bomb". (An archive with all files spread inside instead of being cleanly stored in a common directory).

I think you made a mistake in the command which starts with "ar xv ...".

I wonder where to fetch Chrome from ? (On the web of course!  :P ). I would like you to add the link to the download page please.  :)
Good leaders being scarce, following yourself is allowed.