Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pdf.js analog for Word Documents

I am searching for a JavaScript library that is similar to pdf.js but allows the viewing of Word Documents (.doc and .docx)

Are there any?

UPDATE:

There is an interesting library called DOCX.js

But I'm searching for something more advanced.

like image 461
obenjiro Avatar asked Jan 03 '13 17:01

obenjiro


3 Answers

I doubt it. Behind pdf.js stands Mozilla, so it isn't a weekend project.

There are options to let LibreOffice run in the browser, but I have no first-hand experience with it. Apparently, some cloud projects like NextCloud use it, though.

Then you have Google Docs to import the Word file and let it be displayed there, but there is no way to embed that easily or even host the code yourself. (Also, as I understand it, there are transformations to the Word file on the server involved.)

And after all, if you compare the PDF spec with the OpenXML (aka .docx) spec, it becomes quite clear, that a fully compliant viewer will be a complex beast, to say the least.

like image 199
Boldewyn Avatar answered Oct 26 '22 15:10

Boldewyn


I just found out ViewerJS, but it only supports OpenDocument formats. It's not what you were looking for, but may be worth a shot, specially if you can find a way to convert odt to doc (this question might help).

like image 22
kepler Avatar answered Oct 26 '22 15:10

kepler


At a glance, it looks like Flexpaper can be used to this effect, but it's effectively using a server-side version of open office to convert the document into images that can be viewed on the web. This'll work in a pinch, but certainly lacks the quality of pdf.js.

like image 1
Bubbles Avatar answered Oct 26 '22 17:10

Bubbles