Working with Visio Javascript API and WOPI Host - visio

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:
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)?
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?
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?

Related

Is there a way to copy only views from a Sharepoint 2010 library to SharePoint online library?

I have a SharePoint Online 2010 site, I have migrated all the content from SP 2010 to SPO. Now I want to only recreate the views from the source site (SP 2010). Because there are so many views, doing it manually is going to take a lot of time. So, is there any chance that I can recreate the views same as the one's in the source using Powershell or any other language?
When it comes to "logs"/"reports" in SharePoint online, it is not so easy to get them, but still I have managed to found a couple of ways. Check this article that I have wrote about how to get user's activities in SPO: https://www.alight.ro/Articles/Efficient-Ways-to-monitor-Site-Collection/
It contains both manually and programmatically ways.
If you prefer to do it programmatically, the best way is by using Exchange Online module . By using a simple command "Search-UnifiedAuditLog" you can get all kind of activities users have performed on a file: download, view, edit etc. And all you have to do is to write a script. See sample code:
[enter image description here][1]
In the article you will find what represents each line of code.

Generate multiple sheets in one pdf file

I am trying to generate a pdf from a Tableau workbook which has two sheets using the url method:
E.g: https://TableauServer/views/workbook/sheet1?:format=pdf&parameter=value
I am doing this in a program which will issue the url request to the url. The url works fine for one sheet. But the problem is how to generate one pdf file with both sheets in it?
If you first put your two sheets into a single dashboard and then use the URL for the published dashboard (still using the format=pdf parameter), this should work just fine.
We know it's possible because within the Tableau pages itself if you download a PDF it gives you several formatting options, including the option to put all the worksheets in a workbook into a single PDF.
I couldn't find any documentation on it though. What I ended up doing was looking at the network console in the browser (usually F12) when I downloaded the PDF from the browser by clicking the Download button. That showed me the URL end point and the JSON body the server expected in the request payload.
The endpoint URL wasn't too cryptic and ended with "commands/tabsrv/pdf-export-server". The challenge was to take the JSON in the request payload and find the right settings to get it into a single PDF.
This method is a more technical approach and requires very little coding skills; any language that has functions for http calls will work (I use python for it).
If you don't mind doing it outside a browser, tabcmd has lots of functionality to control PDF generation at the command line.

Implementing Microsoft Word onto website or very similar

I need to implement Microsoft Word into my works website and I'm having real trouble trying to find any information about it. Is there a way to do this? I need mail merge functionality but I don't mind whether it just works with my website (database website)rather than being implemented into it
(I've used CKEditor and TinyMCE but neither are useful for my website/work. I need it to be simple and I'm working with people who just know basic Word)
I don't think you can embed (real) Microsoft Word editing functionality in an arbitrary website.
However, if you are running a Sharepoint server, then you can upload MS Word documents to Sharepoint and edit there them via a web browser via "word Web App". It also allows the user to "one click" download a document and edit it Word installed on their machine.
References:
Microsoft's Introduction to Word Web App
Alternatively, if you are prepared to look at 3rd-party solutions, some are listed in these Q&As:
Embed editable MS Word document on web page
Making Word document embedded in a web page editable or read-only
However, this is dangerously close to asking for a recommendation for software or a web-based service, and that is off-topic.

Previewing files so as not to require download

Facebook has a nice way to preview powerpoint files.. It goes to a microsoft link, e.g. link. You can browse the presentation etc, all very nice and useful for the user and Facebook.
However, I cannot find any sort of API doing that with microsoft.
I found this blog post, which is kindof what I want, but its not referencing any API that I can use to produce this programmatically.
I have a website which users can store files (also powerpoint presentations) and would like them to be able to preview it.
Has anyone got any experience with this? Preferably not going through microsoft route (if possible)..

open ms doc,docx or image file in browser in c#

I have developed the asp.net mvc application. my one form have the file upload control. so in details view i want to implement the facility to view the uploaded document in browser itself. it should not ask for download and should not open MS office instance to open document. its a user req. It should opens in view mode in browser itself. what code i have to do ? I am using C# as language.
It is not straight forward. For images you can use <img>tag and link to the location in server where you saved the uploaded image. That should work.
However ASFAIK showing the doc/docx things in web page itself is not possible. You will have to employ some third party control to achieve that. Search google to find such controls. May come at a cost.