Checking a PowerPoint Presentation File for Corruption Using Aspose.Slides

Is it possible to check for corruption of a file? Currently when we open a corrupt document the whole process is killed, bypassing the error handler.

@mvds

Can you please specify which type of file you are referring to for the corruption check? Is it a Word document or another file type?

We have tested this against a Powerpoint file.

It appears you are using the Aspose.Slides API to read, write, or evaluate PowerPoint (PPT/PPTX) files. As such, I am transferring your thread to the appropriate forum, where one of our Aspose.Slides team members will evaluate your issue or requirements and provide assistance accordingly.

@mvds,
Typically, if no exceptions appear when loading a PowerPoint presentation file, the document is fine. We would greatly appreciate it if you could share the following files and information with us so that we can investigate the case:

  • sample presentation file
  • code example to reproduce the error
  • OS version on which the error occurs
  • Aspose.Slides version you used

Code:

$loadFormat =[Aspose.Slides.PresentationFactory]::Instance.GetPresentationInfo($extendedFilePath).LoadFormat

OS version: Windows Server 2019 Datacenter version 10.0.17763 Build 17763

Aspose Sides Version: 24.9
Digitaal Werken presentatie DMT 18 maart.7z (3.5 MB)

@mvds,
Thank you for the details. It will take me some time to investigate the case. I will get back to you soon.

@mvds,
Thank you for your patience. Unfortunately, I was unable to use your code snippet. Could you please specify which Aspose.Slides API you are using?

Attached a code sample (PowerShell) that shows how to test the case, we use version 24.9).
aspose-sample-code-slides.7z (509 Bytes)

@mvds,
I get the following error:

Cannot find type [Aspose.Slides.License]: make sure the assembly containing this type is loaded.

Could you please clarify which Aspose.Slides assembly you are using?

You can find the used library within this zip file: https://drive.google.com/file/d/14ywhs-xJV6pmvSEKtZx1Pz8BKdD91XdY/view?usp=drive_link

@mvds,
Thank you for the additional information. I need some time to check the problem. I will get back to you soon.

@mvds,
I used the assembly you provided (it is Aspose.Slides 24.9 for .NET Framework 4.0). When I run the script you provided, I get the following error:

Process is terminated due to StackOverflowException.

Are you facing the same error?

Hi Andrey, yes this is exacly what I am seeing. The error should be handled gracefully by the Aspose API instead of killing the calling process like this.

@mvds,
Thank you for the confirmation.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNET-44734

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi, good to hear. Maybe the same principle could also apply for the other API’s ?

@mvds,
Could you please clarify what principle you mean?

The principle that will prevent the format detection method from causing a fatal error concerning the other api’s:

word:

[Aspose.Words.FileFormatInfo]$info = [Aspose.Words.FileFormatUtil]::DetectFileFormat($filePath)

excel:

[Aspose.Cells.FileFormatInfo]$info = [Aspose.Cells.FileFormatUtil]::DetectFileFormat($filePath)

@mvds,
If you have the same problems with Word and Excel documents, please create new topics on the Aspose.Words and Aspose.Cells forums. My colleagues will be happy to help you.