'Is there a way to get the number of slides of a PowerPoint file without decompressing it or without using the Office.js API?
I need a way to find the number of slides in a PowerPoint presentation, using plain Javascript. After googling quite a lot, i've found out two methods, that don't seem to be so practical. The first one is using the Office.js api,but it only works within an Office client and i want it to work in the Browser. The code to get it done is the following, but as i said it doesn't work in the Browser:
PowerPoint.run(async (context) => {
context.presentation.load("demo");
await context.sync();
var slides = context.presentation.slides;
var slideCount = slides.getCount();
await context.sync();
console.log("There are ", slideCount.value, " slides in this presentation");
})
The second method is to decompress the PowerPoint file and get a bunch of xml files. One in particular called 'app.xml' is going to have a <Slides> field which contains the number of slides in the original ppt file.
I found it at the following link: How to get number of slides from uploaded ppt file using Nodejs?.
The problem is that I need to find the number of slides Client side and the method proposed in the link above, could work only Server side, because we need the filesystem to find the 'app.xml' file and get the <Slides> property. So how can i solve this problem?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
