I am currently working with the HTML output functionality that is available that exports the entire presentation in HTML. However, I am only interested in obtaining one slide at a time with maximum speed performance. So in my situation it seems a waste that the the Aspose object has generate the html for the entire presentation, then I also have to parse the html and pull out the slide that I need. Would it be possible to improve performance by having the Aspose object with a method that only pulls back a single slide in HTML?
Another thing, it would also be really helpful to return strings of HTML rather than saving to a file, thus keeping it all in memory and not hitting the filesystem for no reason.
Hi Dan,
Thanks for your inquiring Aspose.Slides.
I like to share that you can use the slide cloning feature to save individual slide in separate presentation and then generating the html file of the generated presentation with cloned single slide. Please visit this documentation link for your further kind reference.
You can get the saved presentation in memory stream rather then getting string. Please use the following code snippet to export presentation in HTML using memory streams.
PresentationEx _presentation = new PresentationEx(path + "test.pptx");
MemoryStream memo = new MemoryStream();
_presentation.Save(memo, Aspose.Slides.Export.SaveFormat.Html);
Many Thanks,
Thanks for the response! I will give the memory stream a try, it looks like it should work great for me.
Unfortunately, I think using the clone feature in this situation means that the page numbers would also be out of sync and need modifying every time. Is there a way to quickly address this without going into the slide structure?
Hi Dan,
I like to add further that in presentation slides collection for PresentationEx, usually the slides are available in order of their position. You may give a try your self by swapping position of slide for PresentationEx using Aspose.Slides. You will observe that position of slide will be modified in SlideExCollection. I hope there will be no issue of out of sync pages.
Many Thanks,
Thanks again, the memory stream method works great, I should have seen this in the documentation.
I’m not sure what you are explaining applies to the method that you suggested to obtain a html preview of a single slide. I believe that you suggested that I clone the slide into a fresh in-memory presentation object, and then simply do an export on that object, thus only requiring the engine to render the single slide and not the entire unnecessary presentation. However, if I do this to a slide that was originally in slide position say 6, and then clone it into a blank presentation, it becomes the first and only slide in the presentation, so the slide number is now 1. The issue is, if I have slide numbers displayed on the slide, the html preview will always display that it is slide #1.
Hi Dan,
I got your problem. In this case, I suggest you to add an AutoShapeEx to hold the page number at exactly same place where the page number from master layout is displayed. you can hide the page number from your source presentation by opening it in PowerPoint and hiding the page number display from footer settings. Since you have the slide number, you first clone the slide in presentation and then add an auto shape to slide holding the slide number. I feel this work around will serve the purpose for you.
Many Thanks,