How To Open PDF Files Inside Chromium?
Asked Answered
G

5

5

I'm using nodejs and chromium for my desktop app. The problem is that I can't open pdf files in chromium. So I googled and found that most of the answers are related to mozplugger plugin. I installed the plugin as mentioned in the below link:

http://www.tootips.com/2013/01/how-to-open-pdf-files-inside-chromium.html

Now I'm getting an error message : "Mozplugger: M4 parsing of config generated error" when I try to open pdf file in chromium. How can I resolve this error?

Please help me!

Garbo answered 25/2, 2013 at 13:4 Comment(2)
What version of Chromium are you using and what operating system are you on?Serrated
I'm using chromium version 21 and linux. I need to open pdf in windows also.Garbo
G
2

In Linux I think we need mozplugger plugin for viewing pdf files. I just removed and installed mozplugger again (Reference links: http://www.tootips.com/2013/01/how-to-open-pdf-files-inside-chromium.html, http://mozplugger.mozdev.org/ ) and now it seems to work.

In windows we need to install a system pdf reader like acrobat (http://www.adobe.com/in/products/reader.html), as chromium downloads and displays pdf with system PDF viewer (Reference link: http://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome).

An alternative solution is to open the pdf link in default browser with help of node.js using below script.

Install the node.js open module:

$ npm install open

use:

var open = require('open');
open('http://www.google.com', function (err) {
  if (err) throw err;
  console.log('The user closed the browser');
});

Reference link: How to use nodejs to open default browser and navigate to a specific URL

Garbo answered 27/2, 2013 at 9:29 Comment(0)
S
8

If you look at this Ask Ubunutu question you'll see you can actually use Chrome's PDF viewer with Chromium.

Chrome has a nice PDF plugin that lets you open in the page, but it's not open source so it's not included with Chromium. You could install Chrome and symlink the plugin, then whenever you update Chrome you would also get that updated in Chromium. Alternatively, you could copy the plugin over to Chromium, and uninstall Chrome, but you won't receive updates that way.

Serrated answered 26/2, 2013 at 18:31 Comment(1)
Thanks for helping me. I solved the issue. Please find my answer.Garbo
V
4

Have you tried using PDFjs as a totally javascript based alternative solution?

https://github.com/mozilla/pdf.js

It is relatively new but works on many different examples, maybe it is good enough for your application.

Viticulture answered 25/2, 2013 at 22:42 Comment(1)
Thanks. I tried it but it won't fetch pdf files from another server. Reference link: jsbin.com/pdfjs-prevnext-v2/1/editGarbo
G
2

In Linux I think we need mozplugger plugin for viewing pdf files. I just removed and installed mozplugger again (Reference links: http://www.tootips.com/2013/01/how-to-open-pdf-files-inside-chromium.html, http://mozplugger.mozdev.org/ ) and now it seems to work.

In windows we need to install a system pdf reader like acrobat (http://www.adobe.com/in/products/reader.html), as chromium downloads and displays pdf with system PDF viewer (Reference link: http://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome).

An alternative solution is to open the pdf link in default browser with help of node.js using below script.

Install the node.js open module:

$ npm install open

use:

var open = require('open');
open('http://www.google.com', function (err) {
  if (err) throw err;
  console.log('The user closed the browser');
});

Reference link: How to use nodejs to open default browser and navigate to a specific URL

Garbo answered 27/2, 2013 at 9:29 Comment(0)
B
1

You can use this extension by Google: ExtensionDocs PDF/PowerPoint Viewer which also allows you to open docx, ppt, rar and many more file types.

Britannia answered 19/7, 2013 at 23:51 Comment(0)
V
0

Google recently announced that Google Chrome PDF Viewer goes to open source. It means that in near future Chromium browser and Chromium OS users can soon enjoy the Chrome PDF viewer, without any workarounds!

See PDFium project web page at https://code.google.com/p/pdfium/

Vada answered 3/6, 2014 at 12:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.