You could use the Microsoft Graph to save the document to the user's OneDrive, convert the document to PDF, and then delete the original. The API used to convert the format of a file in OneDrive is Convert Content. The response from this request includes the URL to the converted document.
convert word document to pdf and render via office.com or web api
My organization uses Microsoft extensively, Sharepoint Online, Office 365, etc. I want a web application to render Word and Excel documents by converting to PDF. I read where a page at office.com can be opened, including the URL of a document, and it will be rendered. Can someone please elaborate on this functionality? The documents are blobs on an SQL Server. Ideally I would like to use HTTP post to send documents to a web address, have it render, and stay within the organization/Microsoft security environment.
2 answers
Sort by: Most helpful
-
-
Tom Jebo 1,991 Reputation points Microsoft Employee
2022-01-28T18:33:25.547+00:00 Hi @David McDivitt ,
What you are referring to may be WOPI. The WOPI protocol enables office web apps (Word, PowerPoint and Excel) to view and edit documents with in a 3rd party web app page. This is useful in situations where you can manage the documents i.e. a file server host application. It sounds like your SQL Server blob solution would fit this scenario.
Are you planning to use the Microsoft cloud provided Office web apps? If so, in order to use a solution with the WOPI protocol, you would need to work with our Cloud Storage Partner Program, information is here:
https://video2.skills-academy.com/en-us/microsoft-365/cloud-storage-partner-program/online/If you are able to use an on-premises solution and can deploy Office Online Server in your enterprise, then you can implement this independently. There is information about deploying OOS here:
https://video2.skills-academy.com/en-us/officeonlineserver/office-online-serverYou can read about the WOPI protocol here:
https://video2.skills-academy.com/en-us/openspecs/office_protocols/ms-wopi/6a8bb410-68ad-47e4-9dc3-6cf29c6b046b - this is the technical specification
https://video2.skills-academy.com/en-us/microsoft-365/cloud-storage-partner-program/rest/ - this is a helpful reference for cloud integrationThere's also helpful information in the first link for both cloud and on-premises integrations, including a reference to a sample host implementation on github which I've linked here:
https://github.com/Microsoft/Office-Online-Test-Tools-and-Documentation/tree/master/samples/SampleWopiHandlerIf you go the on-premises route, questions about the [MS-WOPI] technical specification can be direct to this Q&A forum.
If you go the cloud route, there is a yammer group available to participants after joining.I hope this information helps.
Best regards,
Tom Jebo
Sr Escalation Engineer
Microsoft Open Specifications Support