Hi there,
We are currently trying to outline a strategy for detecting the Aspose component (starting from Detect file types from stream - #7 by codewarior) that could handle a stream based on utilities function like:
var fileFormatInfo = Aspose.Cells.FileFormatUtil.DetectFileFormat(input);
if (fileFormatInfo.LoadFormat != Aspose.Cells.LoadFormat.Unknown)
{
canHandle = true;
}
Aspose.Slides for .NET 20.2.0 does not have such utilities functions and we currently use this piece of code:
var canHandle = false;
try
{
input.Position = 0L;
var loadOptions = new Aspose.Slides.LoadOptions()
{
OnlyLoadDocumentProperties = true
};
using (var presentation = new Aspose.Slides.Presentation(input, loadOptions))
{
presentation.Dispose();
};
canHandle = true;
}
catch (Exception)
{
}
This is not ideal and we were wondering if there are other ways to check this with the latest of Aspose.Slides similar to utilities like Aspose.Words.FileFormatUtil.DetectFileFormat(input) or even the Aspose.CAD.Image.CanLoad(input)?
Thank you!