We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Slides corrupts PPTX file if it contains a [trash] folder

Hi Aspose Team

We're trying to use Aspose to inject content into Word and PowerPoint documents. We have found that when a PowerPoint document contains a [trash] folder, in the Open XML package, Aspose adds the following element to the [Content_Types].xml:


When we try to open the resulting PPTX file with System.IO.Packaging or with the Open XML 2.5 Productivity Tool we get the following error:

"ContentType string is not valid. Expected format is type/subtype."

Manually removing this line from the [Content_Type].xml file or changing the ContentType attribute to a valid value allows the file to be read as a package. For example:


Note, merely opening the PowerPoint file with Aspose and then saving it again immediately will cause this behavior.

The following example will cause the corruption to happen:
public static byte[] UpdateSlideTest(string filePath)
{
using (var presentation = new Presentation(filePath))
{
byte[] buffer;
using (var stream = new MemoryStream())
{

presentation.Save(stream, SaveFormat.Pptx);
stream.Position = 0;

buffer = new Byte[stream.Length];
stream.Read(buffer, 0, (int)stream.Length);
}

// save directly to file
presentation.Save("C:\\Temp\\Direct_aspose_test.pptx", SaveFormat.Pptx);

return buffer;
}
}

We have tried this with Apose.Slide version 15.8.0.0. (This does not seem to happen with Aspose.Words or Aspose.PDF)

Best regards
Corné

Hi Corne,

I have observed the issue shared by you and it seems to be an issue with Aspose.Slides. An issue with ID SLIDESNET-36950 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESNET-36950) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thank you Aspose Team

Hi Corne,

Thank you for your feedback and you always welcome. Please share, if you may need any further help in this regard.

Many Thanks,