Exception"This file format is not supported " on converting PPTX to PDF using Aspose.Slides for .NET

Hi.
I encountered the following error and posted on the Aspose.Cell forum.
However, it was said that this is a problem of Slides.

Can you confirm it?
Best Regard.

@yuya,

I have observed your issue and request you to please share the working sample code, source files and generated output reproducing the issue along with snapshot of issue. Please provide the requested information so that we may proceed further to help you.

Are you looking at the link destination…?
I wrote it on the linked forum …

The environment is below.
powerpoint file -> Office 2016 or Office 365
Embedded excel file -> Office 2016 or Office 365
Aspose.Slides -> 18.10
Aspose.Cells -> 18.11

new.zip is an error file.
Office 2016 or Office 365
new.zip (32.9 KB)
ok.zip is a file that will not result in an error.
ok.zip (32.6 KB)

try
{
    var slides = new Presentation(pptPath);

    foreach (Slide slide in slides.Slides)
    {
        foreach (Shape shape in slide.Shapes)
        {
            string typeName = shape.GetType().Name;

            switch (typeName)
            {
                case "OleObjectFrame":
                    var oleObj = (OleObjectFrame)shape;
                    if (oleObj.ObjectData != null && oleObj.ObjectProgId.Contains("Excel"))
                    {
	                    MemoryStream byteObj = new MemoryStream(oleObj.ObjectData);

	                    FileFormatInfo fileInfo = FileFormatUtil.DetectFileFormat(byteObj);
	                    if (fileInfo.FileFormatType == FileFormatType.Unknown)
	                    {

	                    }
	                    Workbook wb = new Workbook(byteObj);
                    }

                    break;
                default:
                    break;
            }
        }
    }
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}

Best regards.

@yuya,

I have worked with the presentation file shared by you and have created an issue with ID SLIDESNET-40691 in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

1 Like

Hello

How is the response situation of the problem?
I would like you to tell me if I know the prospects for the response and workarounds.

My clients hope to solve problems quickly …
Best regards.

@yuya,

I have observed your comments and regret to inform that issue is still unresolved. I request for your patience and we will share good news with you soon.

@Adnan.Ahmad
@mudassir.fayyaz

Hi.

I am waiting for this problem to be solved quickly, but recently I have noticed one thing I’ve noticed.

Files that can not be read are embedded as “oleObject.bin” in the PPT file,
Actually, further decompression (rar format) of this file contains “Package” file inside.
If you leave “Package” above, you can not distinguish between Excel and Word.
However, further decompression of the “Package” file will contain the file “[Content_Types] .xml”
Looking at the contents, it seems likely to be possible to distinguish whether it is Excel or not.

I hope it will help solve this problem.
Thanking you in advance.

@yuya,

I have observed your comments. I like to inform that we have investigated issue on our end. Can you please use the OleObjectFrame.EmbeddedFileData instead of OleObjectFrame.ObjectData. Because OleObjectFrame.ObjectData can contain not only a file data but also ole object service information. I have shared sample code with you for your kind reference. Please share feedback with us if there is still an issue.

var slides = new Presentation(path + “new.pptx”);

foreach (Slide slide in slides.Slides)
{
foreach (Shape shape in slide.Shapes)
{
string typeName = shape.GetType().Name;

  switch (typeName)
  {
  	case "OleObjectFrame":
  		var oleObj = (OleObjectFrame)shape;
  		if (oleObj.EmbeddedFileData != null && oleObj.ObjectProgId.Contains("Excel"))
  		{
  			MemoryStream byteObj = new MemoryStream(oleObj.EmbeddedFileData);
  			Workbook wb = new Workbook(byteObj);
  		}

  		break;
  	default:
  		break;
  }

}
}

watch.png (3.8 KB)
@Adnan.Ahmad

thank you for your answer.

I looked at your answer and looked at the contents of “EmbeddedFileData” in the latest version of Aspose.Slides (19.1).

However, as a result of checking, the content of “EmbeddedFileData” was null …

Please do not settle it yet …

@yuya,

I have observed your comments. I like to inform that this code snippet will work with Aspose.Slides 19.2 because 19.1 has issue with loading OleObjects in this presentation. I also like to inform that 19.2 is going to be released soon. I request for your patience and we will share good news with you soon.