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

Free Support Forum - aspose.com

Different Content when Upgrading Aspose.Slides to Version 22.2

Hi,
I’m upgrading Aspose Slides to version 22.2, but there is a different from my current version 21.2 with latest version 22.2. The different come from the update of Aspose Slide version 21.12, when ObjectData, EmbeddedFileExtension, and EmbeddedFileData have been removed from the IOleObjectFrame interface and replace by another API.
Here is my current code with sample file:

    var slides = new List<IBaseSlide>(presentation.Slides);
    var shapes = slides[16];
    foreach(var shape in shapes)
    if(shape is OleObjectFrame oleFrame)
    {
    int size = oleFrame.ObjectData.Length;
    byte[] arr = oleFrame.ObjectData;
    }

And with the API update, the new code will be:

    var slides = new List<IBaseSlide>(presentation.Slides);
    var shapes = slides[16];
    foreach(var shape in shapes)
    if(shape is OleObjectFrame oleFrame)
    {
    int size = oleFrame.EmbeddedData.EmbeddedFileData.Length;
    byte[] arr = oleFrame.EmbeddedData.EmbeddedFileData;
    }

The value of size and arr are different after updating. My question is: Is there any way to updating to the latest version 22.2 and keep the same content of OleObjectFrame? Data from version 21.2 have full data of oleObject. If you save the arr to file, output file is a ppt file which have image inside it.
Here is my sample file: sample.zip (810.3 KB)

Thank you.

@dunghnguyen,
Thank you for contacting support.

This presentation does not contain OLE objects and slide index 16 is out of range. Please check this carefully and update your information for the issue you faced.

Hi @Andrey_Potapov,
Sorry for my mistake when trying to shortcut my source code.
Here is my fully source code, can you re-try to see the problem?

        using(var inputStream = new FileStream(@"D:\sample.ppt", FileMode.Open,
                                              FileAccess.Read, FileShare.ReadWrite))
        {
            Presentation presentation = new Presentation(inputStream);
            var tempSlides = new List<IBaseSlide>(presentation.Slides);
            foreach(var masterSlide in presentation.Masters)
                tempSlides.Add(masterSlide.AsIBaseSlide);
            foreach(var layoutSlide in presentation.LayoutSlides.AsILayoutSlideCollection)
                tempSlides.Add(layoutSlide.AsIBaseSlide);
            // foreach(var slide in tempSlides)
            foreach(var shape in tempSlides[16].Shapes)
                if(shape is OleObjectFrame oleFrame)
                {
                    if(oleFrame.EmbeddedData.EmbeddedFileData != null)
                    {
                        int size = oleFrame.EmbeddedData.EmbeddedFileData.Length;
                        byte[] arr = oleFrame.EmbeddedData.EmbeddedFileData;
                    }
                }
        }

Thank you a lot.

@dunghnguyen,
Thank you for the additional data. I’ve reproduced the problem with extracting the embedded PPT file and added a ticket with ID SLIDESNET-43090 to our issue tracking system. We apologize for any inconvenience. Our development team will investigate this case. You will be notified when the issue is resolved.

The issues you have found earlier (filed as SLIDESNET-43090) have been fixed in Aspose.Slides for .NET 22.4 (ZIP, MSI).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.