Hello
I found that Aspose.Slides (in contrast to Aspose.Words or Aspose.Cells) does not remove unnecessary embedded files in its zip-like file format.
I created a small app to demonstrate this:
// Create a simple presentation or open an existing one
using (var presentation = new Presentation())
{
presentation.Save("clean.pptx", SaveFormat.Pptx);
}
// some random data for demonstration, but could be an executable file
var randomData = new byte[128];
new Random().NextBytes(randomData);
// Open pptx as zip and add random file which does not belong to the presentation itself
using var archive = new Archive("clean.pptx");
using var memoryStream = new MemoryStream(randomData);
{
archive.CreateEntry("file.bin", memoryStream);
archive.Save("embedded_file.pptx");
}
// Open presentation again and save it
using (var presentation = new Presentation("embedded_file.pptx"))
{
//presentation.RemoveUnneededFiles() // pseudo code
presentation.Save("not_clean.pptx", SaveFormat.Pptx);
}
// file.bin is still present in the pptx file
So the data remain in the file after saving in Aspose.Slides (in Aspose.Words and Cells it gets removed). I want to prohibit our clients to introduce unwanted files.
When the presentation gets loaded somehow these additional files must be copied over to the dotnet object. So can I manually remove these files from the object somehow? Or is it simply a bug?