Retrieving OOXML of a PPTX file with Office.js leads to bad performance

Copper Contributor

Description

I'm currently developing a M365 PowerPoint Add-in using Office.js. For my requirement I need to retrieve the OOXML structure of the PowerPoint file.

 

The only way to get the OOXML structure is to request the compressed file by using Office.context.document.getFileAsync method:

 

 

 

 

 

Office.context.document.getFileAsync(Office.FileType.Compressed, { sliceSize: 65536 /*64 KB*/ },
            (result) => {
// Do something
            });

 

 

 

 

 

https://learn.microsoft.com/en-us/office/dev/add-ins/word/get-the-whole-document-from-an-add-in-for-...

 

This method works fine, I'm retrieving the XML structure of the document and can further process it.

When I test my add-in in the PowerPoint desktop application, everything works smooth. The time of execution of course depends on the size of the file, simple PPT (40 kb) takes only a few miliseconds.

Issue:

When I test my add-in in the PowerPoint for web application, the request takes a lot of time in comparison to the size of the document. The request to get the XML file of the presentation varies between 10 and 40 seconds.

 

The actual HTTP Request which takes the most time is the following:

POST https://euc-powerpoint.officeapps.live.com/pops/ppt/edit.svc/jsonAnonymous/ForceSaveToHost

msccsascha_0-1685622656141.png

 

I tested the behaviour in different browsers, that does not make any difference.

 

Questions

  1. Any idea, how to improve the performance here?
  2. Is there any other way (except enabling SSO and processing the file server side) to get the OOXML structure of the document?

 

0 Replies