Results 1 to 4 of 4

Thread: Embedded document Viewer to display PDF and Office documents ?

  1. #1
    Sencha Premium User
    Join Date
    Oct 2016
    Posts
    21
    Answers
    1
    Vote Rating
    1
      0  

    Default Embedded document Viewer to display PDF and Office documents ?

    Hello,

    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 :
    Code:
    var url = ... <urlCallingAnApiLoadindDocumentContent> ...
    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.

  2. #2
    Sencha Premium Member tjstuart's Avatar
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    452
    Answers
    4
    Vote Rating
    30
      0  

    Default

    Pretty sure you need go down the MS Web Application Open Platform Interface (WOPI) path. Same thing that Office Web Apps / Office365 uses I think. Or just use Office Web Apps (OWA) eg. the Word Web App, Excel Web App and embed some WOPIFrame in your app. Also, I believe you can get OWA to source its documents from disk vs a beast like SharePoint.

    https://stackoverflow.com/questions/...client-example

    You could also just convert your MS docs to PDF on the fly and render these, thus eliminating the need for anything MS specific.

    Good luck

  3. #3
    Ext JS Premium Member dtex-lab's Avatar
    Join Date
    Sep 2009
    Location
    Italy
    Posts
    392
    Vote Rating
    7
      0  

    Default

    HI
    You can try to use an IFRAME (Ext.ux.IFrame) or other tools like http://viewerjs.org/
    Regards
    we make IT work for you

  4. #4
    Sencha Premium Member tjstuart's Avatar
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    452
    Answers
    4
    Vote Rating
    30
      0  

    Default

    Quote Originally Posted by dtex-lab View Post
    HI
    You can try to use an IFRAME (Ext.ux.IFrame) or other tools like http://viewerjs.org/
    Regards
    Nice. Didn't know about that.

Similar Threads

  1. How to Integrate Office Viewer Component with EXt JS
    By valadi in forum Ext: Discussion
    Replies: 1
    Last Post: 22 Jun 2016, 6:00 AM
  2. How to handle embedded documents?
    By ericchaves in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 16 Jan 2013, 10:48 AM
  3. Embedded PDF viewer available in Sencha?
    By Winnie Lam in forum Sencha Touch 1.x: Q&A
    Replies: 2
    Last Post: 25 Jan 2012, 10:48 AM
  4. Touch based online office viewer
    By ffzhuang in forum Sencha Touch 1.x: Examples and Showcases
    Replies: 0
    Last Post: 1 Jul 2011, 6:34 AM
  5. Example of loading documents (pdf, .doc, etc) in embedded iframes
    By abierbaum in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 13 Jun 2011, 6:57 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •