Aspose.Slides Presentation to HTML5 Conversion in C#: Issue under Linux

Hello.
Our .net project targets two platforms and is used on both Windows and Linux, and as such we are using 2 versions of Aspose.Slides.

PackageReference Condition="$(TargetFramework) == 'netstandard2.0'" 
Include="Aspose.Slides.NET" Version="23.11.0" />"
PackageReference Condition="$(TargetFramework) == 'net6.0'" 
Include="Aspose.Slides.NET6.CrossPlatform" Version="24.2.0" />"

We have found an issue with a presentation conversion to html5 when text is in Japanese,
where when given a pptx file with 2 slides, which contains japanese language, the result differs if you are on Linux or Windows.

I have attached the pptx file used, as well as both converted Html files, one under Linux and one under Windows, a png with the Linux html result opened in browser, and a pic of the code snippet we use to execute the conversion.

We have tried using the latest version of the NET6.Crossplatform 24.6.0, with the same result.
The OS tests i did were both under a net8 project, and they loaded the Crossplatform library.

Please let me know if you need any other info, thank you!

AsposeSlidesPptxHtmlIssue.7z (224.1 KB)

@IBurzoEvoRWS,
Thank you for describing the issue. I am working on the issue and will get back to you soon.

@IBurzoEvoRWS,
This issue might indicate that the fonts used in the presentation are missing from the operating system on which the code was executed. Please ensure that the “MS Mincho” font is installed on the operating system you are using for the conversion and that it is accessible to your application.

Alternatively, you can load this font before converting the presentation as follows:

FontsLoader.LoadExternalFonts(new string[] { "path_to_my_fonts" });

Custom PowerPoint Font in C#|Aspose.Slides Documentation
FontsLoader | Aspose.Sildes for .NET API Reference

Considering that we dockerize our solution, i am assuming that i would need to add some font library to the docker file generating the image (We use Amazon Linux 2 net8 as base)

I will get back to you once i do some tests, thank you!

@IBurzoEvoRWS,

You can try this or add your fonts to your project to copy into the Docker container.

We will be waiting for your feedback. Thank you for using Aspose.Slides.

Came back to say that it appears that the container in which the first text is placed in causing this issue.
The second slide text works as expected, which means we DO in fact have the MS Mincho font on.

We removed the container and left only the japanese text and the issue doesn’t reproduce anymore.
Please try it yourself, remove the container the first slide text is in, and feed the updated pptx to the converter and see that it works correctly on our end. Any ideas regarding this?

Thank you for the quick responses by the way!

@IBurzoEvoRWS,

Please see what the font “MS Mincho” looks like: MS Mincho font family - Typography | Microsoft Learn. It doesn’t look like the one that appears in your HTML document. Therefore, the font is not installed on the OS or the font is not applied during the conversion.

Please check if the font has been replaced using the following code:

var html5Options = new Html5Options
{
    AnimateShapes = false,
    AnimateTransitions = false,
    WarningCallback = new ExportWarningHandler()
};

using var presentation = new Presentation("JapDoc.pptx");
presentation.Save("output.html", SaveFormat.Html5, html5Options);
class ExportWarningHandler : IWarningCallback
{
    public ReturnAction Warning(IWarningInfo warning)
    {
        Console.WriteLine(warning.Description);
        return ReturnAction.Continue;
    }
}

Do messages appear like below?

Font will be substituted from MS Mincho to {Arial, …}

Hello!
Finally got back to this issue and tested out the code provided.
We do indeed get warnings, but not for replacing MS Mincho, but from Aptos Display (???)

image.png (4.0 KB)

Any ideas why this is happening?

@IBurzoEvoRWS,
The idea is the same as described above. Your presentation uses the font “Aptos Display” but it is not installed in the OS.