Galactic_Warrior
Galactic_Warrior

Reputation: 73

Jquery Plugin for viewing files (JPEG, PDF, DOC)

I have different file types such as pdf, jpeg, doc etc. I am trying to show the files without downloading. I was using Lightbox and it worked great for images files. But it doesn't work for PDFs and DOCs.

Is there any plugins to view different file types such as pdf, jpeg, doc etc?

Is there also a way to view pdf and doc using Lightbox?

Upvotes: 4

Views: 4786

Answers (1)

naqushab
naqushab

Reputation: 804

You can't render Word docs using client side libraries. As a hack you can use Google Docs to render their preview in an iframe as following

<iframe src="http://docs.google.com/gview?url=http://remote.url.tld/path/to/document.doc&embedded=true"></iframe>

Where URL is URL of the doc file.

For rendering PDF, you can use pdf.js

Upvotes: 1

Related Questions