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

Free Support Forum - aspose.com

Ppsx - pptx

Hi
I have a path to a presentation file in my code. I don’t know if it is a PPSX or PPTX.
I am loading it with Aspose.Slides.Presentation as a PPTX. Is there any way to know if it is PPTX or PPSX after the loading? Any property?

Thanks
Tali.

Hi Tali,

Thank you for posting.

I have observed your comments and like to request you to please visit http://www.aspose.com/docs/display/slidesnet/Getting+the+format+of+a+file for your kind reference.

I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,

Thank you very much for your quick answer.
I have tried your example with a PPSX encrypted file:

IPresentationInfo info;
info = PresentationFactory.Instance.GetPresentationInfo(inputFile);

And I am getting that info.LoadFormat = LoadFormat.Pptx even though it is an encrypted PPSX.
Can you help please?
I have attached the file. I have added an extension “zip” since your files attachment loader is not supporting “PPSX”, so feel free to remove this extension.

Hi Tali,


I have observed your comments and like to share with you that actually pptx and ppsx are exactly the same files, except the extension. That is why the LoadFormat property is ambiguous. I request you to please try using following sample code on your end to serve the purpose. Since your file is password protected and I am unable to load it without a password. So I have tested it using a different file. This documentation article explains how to load an encrypted presentation and below is the code for checking if the file is pptx or ppsx.

Presentation pres = new
Presentation(path);<o:p></o:p>

FileInfo fi = new FileInfo(path);

switch (fi.Extension.ToLower())

{


case “.pptm”:


{

Console.WriteLine(“It’s a pptm
file”
);

break;


}


case “.pptx”:


{

Console.WriteLine(“It’s a pptx
file”
);

break;


}


case “.ppsx”:


{

Console.WriteLine(“It’s a ppsx
file”
);

break;


}

}


Please let us know if the issue persists. We will be glad to help you further.

Best Regards,