Get the File Format of Presentation

In order to get the file format. Please follow the steps below:

  • Create an instance of IPresentationInfo class
  • Get information about the presentation

In the example given below, we have got the file format.

Example


 string FilePath = @"..\..\..\Sample Files\";

string FileName = FilePath + "Getting the format of a file.pptx";

IPresentationInfo info;

info = PresentationFactory.Instance.GetPresentationInfo(FileName);


switch (info.LoadFormat)

{

    case LoadFormat.Pptx:

        {

            break;

        }

    case LoadFormat.Unknown:

        {

            break;

        }

}

Download Sample Code

Download Running Example