Font Styles Are Not Applied when Converting PPTX to PDF in C#

Currently I have the same problem when converting from PPTX to PDF.
I’m using:

  • Aspose.Slides.NET version 22.7.0
  • .NET 6.0 Framework
  • Linux Alpine inside Docker container:
    • mcr.microsoft.com/dotnet/sdk:6.0-alpine base image to build the app and
    • mcr.microsoft.com/dotnet/runtime:6.0-alpine base image to run the app

@Plotkins,
Thank you for contacting support. To check the problem you are experiencing and help you properly, we need more data and information. Please share the following:

  • input presentation file
  • output PDF file
  • code example that reproduces the problem
  • docker file you used

You can zip the files and upload them here. Please also note that Aspose.Slides does not support .NET 6 yet.

Hi,

I was experiencing the same thing (missing texts/font styles not applied) when trying to convert pptx to pdf. Apparently you can fix this by installing the mscorefonts to the Linux system itself. But in our view, this is more of a just a workaround so I ran through the docs of Aspose.Slides and I’ve found out a possible fix which was setting up the DefaultRegularFonts save options.

It says here that when a font is not found it will be replaced by the default regular font configured on this option (considering the default regular font is also installed). But when I tried it out, the text is still missing. Anything I am missing here or could really be a bug?

pres.Save(output, SaveFormat.Pdf, new PdfOptions
{
    AccessPermissions = PdfAccessPermissions.None,
    Compliance = PdfCompliance.Pdf15,
    DefaultRegularFont = "Arial"
});

Environment:

  • WSL (Ubuntu 20.04)
  • Aspose.Slides.NET v22.8

Input and Output Files

@eugene.ee13,
Thank you for contacting support.

I’ve added a ticket with ID SLIDESNET-43443 to our issue tracking system. Our development team will investigate the case. You will be notified when the issue is resolved.

Please public each new issue in a new forum thread in the future.

You can also load fonts used in a presentation as external fonts using the FontsLoader class as follows:

FontsLoader.LoadExternalFonts(yourFontFolders);

Document: Custom Font

I’ve added a ticket with ID SLIDESNET-43443 to our issue tracking system. Our development team will investigate the case. You will be notified when the issue is resolved.

Thank you, hoping for this issue to be resolved.

Please public each new issue in a new forum thread in the future.

Not sure about this part, should I enable an option somewhere? I thought I was replying to the thread as public. My bad.

You can also load fonts used in a presentation as external fonts using the FontsLoader

Thanks for sharing this another option. But on our end, I think font loading is not the issue, since texts are shown on the converted file when the font is installed. So I guess, that the proper directory path is loaded right?

What I think we want to achieve is the usage of DefaultRegularFonts (which seems to be faulty right now) and then we could set it to widely used fonts (Arial, Times New Roman or etc.) so it will be easier to manage on our end. Our app will be used by different clients and we have no idea of the fonts they will be using on their presentation so a fallback/default font might be a good solution for our use case.

@eugene.ee13,

It is more convenient for everyone if separate forum threads are created for separate issues and different users. NewTopic.png (11.8 KB)

Usually, a font that is not present in the operating system is replaced with a suitable one (taking into account visual characteristics). The DefaultRegularFont option allows you to set a specific font for such cases. Thus, the problem here is also that no font is found for the replacement.

It is more convenient for everyone if separate forum threads are created for separate issues and different users.

Okay, this is noted. Will do it in the future. I just found that this issue is similar to what we are experiencing so I thought of just putting it here. Thanks for the guidance.

Usually, a font that is not present in the operating system is replaced with a suitable one (taking into account visual characteristics). The DefaultRegularFont option allows you to set a specific font for such cases. Thus, the problem here is also that no font is found for the replacement.

Yes, this is understood. Please keep us posted on the status of SLIDESNET-43443. Thanks!

@eugene.ee13,
Thank you for using Aspose.Slides, we will notify you.