PPTX to HTML in C#: An Object Reference Exception Occurs During Saving

Hello. Using the attached document here:
ObjectRefException.7z (158.4 KB)

We are trying to convert it to HTML using Aspose.Slides.Net6.Crossplatform (both windows and Linux)
and it fails during presentation save with the following stacktrace:
image.png (14.0 KB)

The code is nothing special, quite literally just opening the presentation and saving it:

var pptFilePath = "ObjectReferenceIssue.pptx";
var pptSavePath = "ObjectReferenceIssue";
using (Presentation presentation = new Presentation(pptFilePath))
{
    presentation.Save(pptSavePath, SaveFormat.Html5, new Html5Options
    {
        AnimateShapes = false,
        AnimateTransitions = false
    });
}

Any ideas? thank you!
Edit: Versions used were [24.11.0] and also latest [25.6.0], both fail

@IBurzoEvoRWS

It seems you’re encountering an Object reference exception when trying to convert a PPTX file to HTML using Aspose.Slides. This type of error typically indicates that there may be an issue with the content of the presentation or how it’s being processed during the conversion.

Here are a few suggestions to troubleshoot this issue:

  1. Check for Corrupted Content: Sometimes, the presentation may contain elements that are corrupted or not compatible with the conversion process. Try opening the PPTX in PowerPoint and saving it again to see if that resolves any underlying issues.

  2. Update Aspose.Slides Library: Ensure that you are using the latest version of the Aspose.Slides library, as updates may contain bug fixes and improvements related to conversion issues.

  3. Simplify the Presentation: If possible, try reducing the complexity of the presentation. Remove any animations, transitions, or embedded objects and see if the conversion succeeds.

  4. Error Handling: Implement additional error handling in your code to capture more specific details about the exception. This might help identify which part of the presentation is causing the issue.

  5. Consult the Documentation: Review the Aspose.Slides documentation regarding any known issues or limitations related to saving presentations in HTML format.

If these suggestions do not resolve the issue, consider reaching out to Aspose support with the specific presentation file and error details for more targeted assistance.

Sources:

We cannot ask our users to modify their documents just for the conversion, but i have done a bit of testing and i think the issue are these bars here:

image.png (36.1 KB)

After deleting these, the document was converted successfully. Hope this helps with your
internal investigation

@IBurzoEvoRWS,
Thank you for reporting on the issue. I’ve reproduced the problem with the NullReferenceException when converting the PowerPoint presentation to an HTML5 document. We are sorry that you encountered this problem.

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-45017

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.

1 Like

The issues you found earlier (filed as SLIDESNET-45017) have been resolved in Aspose.Slides for .NET 25.7 (ZIP, MSI, NuGet, Cross-platform).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.