Working with Visio Javascript API and WOPI Host

447 Views Asked by At

We have developed a WOPI Host that serves Word and Visio files to the Wopi Client (Which is Office for the web). We have been trying hard to see if we can get "shape info" of the shapes in the visio files that are loaded by the wopi client. We referred to the Microsoft documentation on using the Visio Javascript API: https://learn.microsoft.com/en-us/office/dev/add-ins/reference/overview/visio-javascript-reference-overview#visio-javascript-api-reference , however, we cannot get it to work. We see in the sample code that that the embed url for the visio file from the SharePoint is being used. However, when we try the same, we get an error as below:

(Please click on the below link to see the image... apparently I don't have enough credits to post images :-( ) Error with Visio file from SharePoint

On the other hand, when we use the url from WOPI host, the file loads in the iFrame, however, we can't get any information of the shape that is selected and we get an error which is not of type OfficeExtension.Error and the error is shown as empty as seen below:

(Please click on the below link to see the image... apparently I don't have enough credits to post images :-( )

Loading Visio from WOPI Host

Now the question that we have are as follows:

  1. Does Visio Javascript API work the same way irrespective of the way the visio files are loaded? (i.e., with Visio from Sharepoint and Visio from WOPI host)?
  2. If the answer to question 1 is yes, what could be the reason the sample code doesn't work. Any specific areas that we can look in to?
  3. If the answer to question 1 is NO, then is there a way to get shape info of the shapes in visio files that are served by the WOPI host?
0

There are 0 best solutions below