0

I'm currently using ExtJs 6.5.2. My application manage many electronics documents, and a screen allows users to find documents. User can also view a selected document into an embedded viewer.

For PDF content all works fine with this code :

var url = ... 
var html = '<object style="width:100%;height:100%;" data="' + url + '" type="application/pdf"><embed src="' + url + '" type="application/pdf" /></object>';
container.setHtml(url);

But I can't display another document mime type. It doesn't works for Word or Excel document. If I change object type attribute to "application/msword" or "application/vnd.ms-excel", I've on my page the following error : "This plugin is not supported".

Do you know if it's possible with ExtJs (or with an external library) to display as well pdf document and also Office documents ?

I've the following constraints :

  • the document viewer must be embedded into my page and not display the document content as a different tab into the browser
  • document are not stored as file (filesystem) on my server but read and extract on the fly from my database (filestream). The page call an server API Rest that load and return the document content.
VyTre
  • 103
  • 3
  • 14
  • i think that answer could help you: https://stackoverflow.com/questions/27957766/how-do-i-render-a-word-document-doc-docx-in-the-browser-using-javascript?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Fabio Barros May 17 '18 at 17:13
  • Thank you for the reply. Unfortunately, I can't use this solution for security reasons. Because we don't want that content of our customers' documents are send to a third party. We are looking for an integrated solution in our application, as an external library or a embedded code. – VyTre May 18 '18 at 07:01

0 Answers0