PowerPoint to HTML5 Conversion in C# Does Not Work as Expected

I’m currently testing Aspose.Slides to see if are able to migrate from a current solution that requires MS Office automation approach. While it appears that conversion to PDF works as expected (additional tests are still in progress), Html5 does not work as hoped. Background color is missing completely on some of the slides and I don’t quite get why the slides are not being shown full screen. I think this should the the default option while now the outcome is very small, which we can really use. I’m trying to understand what would be the best way to evaluate the product the best way possible as there might be certain things that I might be using wrongly (though just followed some of the examples from your help pages) to make the best usage of the temporary license I have received.

Thanks

@samirka,
Thank you for contacting support.

To better understand the issues you are facing, please share the following files and information:

  • input presentation file
  • code example that reproduces the problems
  • output HTML file
  • OS version on which the conversion was performed
  • Aspose.Slides version you used

You can zip the files and upload an archive here. Then we will do our best to help you.

Hi Andrey, sure. Here is the link to the files you can download:

https://app.box.com/s/w4bj8giqdtg2pt7r72miq86pqzu4oer8

It contains an original PowerPoint presentation and three additional files:

  • PDF generated by Aspose.Slides
  • HTML5 generated by Aspose.Slides
  • HTML5 generated by other 3rd party solution (Office automation based)

You will see that PDF and other 3rd party generate output as expected. HTML5 generated by Aspose is not that much.

And the code is very simple as listed here https://docs.aspose.com/slides/java/export-to-html5/:

using (Presentation pres = new Presentation("MongoDB_pt.pptx"))
{
   pres.Save("MongoDB_pt.html", SaveFormat.Html5, new Html5Options
   {
       AnimateShapes = true,
       AnimateTransitions = true
   });
}

Thank you

@samirka,
Thank you for the details. I’ve reproduced the problems you described when converting the PowerPoint presentation to an HTML5 document.

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-44366 (Slide background is missing when converting PPTX to HTML5)
  SLIDESNET-44367 (Hyperlink color is changed when converting PPTX to HTML5)

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.

Could you please also describe the expected result regarding this issue?

Hi @andrey.potapov . Thanks for the update. Once again, we are evaluating purchasing Aspose as a replacement of the existing solution (I have included the output created by it) and the fact that literally on the first PowerPoint conversion we are getting this behavior is not very encouraging to be frank. So this is not about paid vs free support but mostly about maturity of Html5 conversion functionality.

To answer your question about full screen vs non-full screen, could you open html5 document produced by Aspose and the one created by the other 3rd party solution? You will see what I mean then. I’m pretty sure it’s just a minor change in the code but makes a world of a difference while viewing it.

Thanks

@samirka,
Thank you for the additional information. Unfortunately, I was unable to convert the presentation to an HTML5 document with the full-screen size of slides. We have opened the following new ticket(s) in our internal issue tracking system:

Issue ID(s): 
  SLIDESNET-44368 (Full-screen size of slides when converting presentation to HTML5)

Our developers will do their best to resolve the issue. You will be notified when a new release with the feature is published.

Hi @andrey.potapov thank you once again. I have noticed that the tickets have been reported under .Net framework, but I have also run the same tests with Java components and the result is exactly the same. So the behavior is not .Net specific. I hope, when this is fixed it’s done at least in both places.

Thanks

@samirka,
Could you please specify in which programming language you would like to use Aspose.Slides?

@andrey.potapov It’s going to be either Java or .Net. Right now .Net6 requires some additional libraries if not executed on Windows (and on Mac with Apple silicon I can’t even get Aspose.Slides to run at all since the MacOS Gatekeeper seeing libaspose.slides.drawing.capi_appleclang_arm64.dylib as malicious software). So Java looks like the only valid choice for now. However if .Net Aspose.Slides will somehow start working on Mac then .Net might be a valid choice as well.

Thanks

@samirka,
Once the problems you found are resolved in Aspose.Slides for .NET, they will be resolved in the same version of Aspose.Slides for Java.

Could you please indicate which version of Aspose.Slides for .NET you used?

@andrey.potapov I’ve been testing with the latest version available 23.12 (both .Net and Java)

@samirka,
You can try using Aspose.Slides for .NET Standard on macOS. This target version of Aspose.Slides is included in Aspose.Slides for .NET package.

@andrey.potapov I could not get working on my Mac. The error I was getting was related to System.Drawing.Common library not be supported in this platform. Even Microsoft is saying it’s not going to be supported and needs to be migrated to some different libraries:

https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only

And thus I was using the following approach listed on your own site:
https://releases.aspose.com/slides/net/release-notes/2023/aspose-slides-for-net-23-6-release-notes/#net-6-nuget-depends-on-systemdrawingcommon-a-cross-platform-version-is-available-in-the-zip-and-msi-releases, which as I was saying was triggering security issue on my Mac

Unless there is some other solution I’m not aware of, .Net version does not work. Please test that yourself I’m pretty sure you’ll get the same result

Thanks

@samirka,
As I can see, you used Aspose.Slides for .NET 6. Could you please check your results using Aspose.Slides for .NET Standard 2.1? Please take a look at the NuGet and ZIP Packages section here:

@andrey.potapov Thanks, I’ll try that. Just to make sure .Net6 and onwards (.Net7 & .Net8) are not supported right now, right? Because I tried .Net8 and the result was the same. Let me try .Net Standard 2.1 as you have suggested. Will let you know the outcome shortly.

In addition are there any plans to migrate System.Drawing.Common going forward? There are many new feature that have been added since 2.1 so it would be nice to take advantage of that as well.

Thanks

@andrey.potapov I was not able to run the test as suggested on .net standard 2.1. Since I have .Net6 and .Net8 installed on my Mac, the project. file I was setting to:

<TargetFrameworks>netstandard2.1;net6.0</TargetFrameworks>

and this is what I was getting:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at.(Font )
   at.(String , ,  , Boolean , Int32 , & )
   at.( , ,  ,  ,  , Int32 , Boolean ,  , &)
   at .(& , Boolean&)
   at .()
   at ..ctor(TextFrame , , IBaseSlide , , [] )
   at .( , )
   at .( , Single, Single ,  )
   at .( , &, RectangleF& ,  )
   at .()
   at Aspose.Slides.Paragraph.GetRect()
   at (TextFrame , AutoShape)
   at .(TextFrame )
   at .()
   at [T](String , TemplateContext`1, TextWriter )
   at .[T](TextWriter , String, TemplateContext`1 )
   at.()
   at [T](String , TemplateContext`1, TextWriter )
   at .[T](TextWriter , String, TemplateContext`1 )
   at .(IShape , Slide, Boolean , Int32 , Dictionary`2 )
   at .()
   at [T](String , TemplateContext`1, TextWriter )
   at .()
   at .Compile(String , Object)
   at .Write(Stream )
   at .Save(String , IOutputFile)
   at Aspose.Slides.Export.Web.WebDocument.Save()
   at .(Presentation , Stream, IHtml5Options )
   at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)
   at Aspose.Slides.Presentation.Save(String fname, SaveFormat format)

I was referencing Aspose.Slides as a Nuget package.
Anyway, this what I meant with Java package just working in comparison with .Net

Thanks,

@samirka,

Cross-platform Aspose.Slides for .NET 6 can be used for .NET 7 and future .NET releases. Please take a look at this article.

Aspose.Slides for .NET NuGet package contains an assembly for .NET 6 that depends on System.Drawing.Common (for Windows only). Aspose.Slides for .NET ZIP and MSI packages contain the same and additionally, cross-platform version that does not depend on System.Drawing.Common.

Please also try using the following package:

@andrey.potapov that did the trick, thank you!

@andrey.potapov While I’m able to tun the code right now, I’m curious why cross platform Nuget package is not the same version as the the main one 23.11 vs 23.12. According to the release notes there are rather important bugfixes in the latest version: https://releases.aspose.com/slides/net/release-notes/2023/aspose-slides-for-net-23-12-release-notes/

2 posts were split to a new topic: Is There an Easy Way to Find Out If PowerPoint Needs to Be Converted to HTML5 Due To Either Video, Audio or Some Animation?