2
votes

My application is hosted in a VM on Microsoft Azure and handles MS-Office documents (.doc, .docx, .xls, .xlsx, .ppt, .pptx). Users need to view these documents stored on Azure Storage Service.

I'm looking for a viewer to integrate with my application. Before showing these files, my application does some validations, to check if user can view the file, print or download. In some cases, when users request to view an OpenXML document (.docx), my application first modify the file before showing it to user.

My 1st choice was using the free viewer from Microsoft ( http://products.office.com/en-us/office-online/view-office-documents-online ), integrating it to my application through an iframe, but I cannot limit user access on the files - there's no parameters to disable printing or download.

My 2nd choice was converting these documents to PDF and using a PDF viewer, but convert these documents to PDF requires proprietary solutions (like Aspose) and Excel files don't have a good appearance when converted to PDF.

After eliminating the options above, I was thinking on a new VM with Office Web Parts and Sharepoint to do this. Is Office Web Apps a good alternative? Can I use Office 365 instead? Can I integrate with my application, limit user actions on the documents and view files out of OneDrive or Sharepoint database?

Please, let me know if you have any other solutions. Thank you.

2
did the below solution work for you?Rami Sarieddine

2 Answers

8
votes

You can install Office Web Apps Server on a VM in Azure, you don't need SharePoint or anything else, Office Web Apps Server is a standalone product and it's free for Viewing only. Web Apps Server has well documented WOPI (Web Application Open Platform Interface Protocol) which you can use to connect to your custom document system. There are various blogs and samples around on how to do a custom host for WOPI. Here are some Resources.

Introduction to WOPI

WOPI Protocol Documentation on MSDN

Example of Custom WOPI Host Build with MVC

WOPI -- Good Simple Explanation

Have a look at CheckFileInfo Json, it has an option to pass true to "DisablePrint" and loads of other options, there are some undocumented one like FileSharingUrl which I found when tinkering with SharePoint 2013 & Office Web App.

Note that Office Web App Server will not install on a VM with SQL Server or any other server product like SharePoint. I am not sure if you can use the Office Web Server on Office.com to connect to your own Document System via WOPI Protocol

0
votes

Per the EULA Office Web Apps / Office Online Server may not be deployed in Azure (or any other public cloud for the matter). Per the EULA when you install OOS: User Rights… You may run any number of instances of the server software in any number of physical and virtual operating system environments on any Server dedicated to Customer's use. Server is defined as a physical hardware system capable of running server software.

Basically because the physical Servers in Azure are shared by multiple customers, by definition they are not dedicated to a single customer's use. Hence why you won't find any reference on a Microsoft web site depicting any scenarios where OWA or OOS is deployed in Azure.