Chromium downloads all PDF files initially instead of of opening them within the browser
Solution 1
You have two main options:
Install an extension. For example this one: Docs PDF/PowerPoint Viewer (by Google) which lets you view PDFs in Google Docs.
-
While
chromium
does not provide this,chrome
does, so you can steal it from there. First, download thechrome
.deb:wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Or, if you are running a 32bit system:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb
Now, extract
libpdf.so
from the file you downloaded. I don't use Unity but I believe you can do this using by right clicking the file and choosing Open With => File Roller or Archive Manager or similar. From the terminal you can do:dpkg -x google-chrome-stable_current_amd64.deb ./ && cp ./opt/google/chrome/libpdf.so . && rm -rf etc opt usr
That will unpack the .deb, copy
libpdf.so
to the current directory and delete the unpacked data. You can now copylibpdf.so
to/usr/lib/chromium-browser/
:sudo cp libpdf.so /usr/lib/chromium-browser/
Now restart your
chromium
and you should be able to view PDF files.
Solution 2
Install Docs PDF/PowerPoint Viewer in chromium.
It will let you open pdf file in browser. You can also download those file if you wish.
By clicking on a link for a supported document format you'll be taken to the Google Docs Viewer. On the options page you can also disable any file formats you don't want to use the Viewer for.
Related videos on Youtube
asood91
Updated on September 18, 2022Comments
-
asood91 almost 2 years
Whenever I click on a link which contain a PDF file, Chromium automatically downloads the file. Instead, I would like to open it for my viewing rather than downloading it.
How can I achieve this?
-
AzkerM over 10 yearsOpen a new-tab & type
chrome://plugins/
, then check whether inbuilt Chrome PDF Viewer is enabled. Also go tosetting > Show advanced settings...
& click content setting under privacy, then refer to plug-ins whether it is set to run automatically
-
-
Radu Rădeanu over 10 yearsNice trick to steal from Google Chrome ;)
-
terdon over 10 years@RaduRădeanu thanks :) I got the idea from here.
-
terdon over 10 years@Guru my chromium does not come with
libdf.so
, which version are you using? Does it contain alibdf.so
file? -
terdon over 10 years@Guru then why are you suggesting using an extension in your answer? Do you mean that it's working fine if you have the extension installed? Of course it does. My answer explains how to do it natively in
chromium
, in the same way aschrome
does it.