0

I store word doc/docx as binary data file in mongoDB (not GridFS) and I would like to display it in my AngularJS client.

I probably should use Google Docs Viewer but what I would like to know is how how should mongoose send the file and how AngularJS should use the object it received to display it.

Community
  • 1
  • 1
chenop
  • 4,743
  • 4
  • 41
  • 65

1 Answers1

0

There aren'y currently any projects out there that allow you to render doc/docx in a browser (that I know of).

Your best bet would be to convert the document to HTML or a PDF before you store it in MongoDB (Apache Tika https://tika.apache.org/ can help with this).

If you are using HTML you can then render that easily enough, if you went for PDF take a look at PDF.js - https://mozilla.github.io/pdf.js/

Ant Kennedy
  • 1,230
  • 7
  • 13
  • Thanks, But I think the Google Docs viewer is an easier approach. For example take this doc: http://infolab.stanford.edu/pub/papers/google.pdf. And see how it was placed in here: http://googlesystem.blogspot.co.il/2009/09/embeddable-google-document-viewer.html – chenop May 21 '16 at 05:19