DOCX to PDF conversion - how to set font path for missing fonts in .NET

I am using desktop version of the converter api in dotnet. I wish to add any missing fonts at certain path and then set it as path for fonts in PdfConvertOptions class but I didn’t found any fontPath property in this class so how can I do that.

PdfConvertOptions options = new PdfConvertOptions();
options.Watermark.Transparency = 0.60;
options.Watermark.Left = 100;
options.Watermark.Top = 550;
options.FontPath = //No Font Path Property

fontPath.PNG (19.3 KB)

1 Like

@ashishk2909

Please have a look at the following code:

GroupDocs.Conversion.Options.Load.LoadOptions getLoadOptions() => new PdfLoadOptions
{
    DefaultFont = "Open Sans",
    FontSubstitutes = new List<FontSubstitute>
    {
        FontSubstitute.Create("Algerian","Verdana")
    }
};
using (Converter converter = new Converter("test.pdf", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("output.pptx", options);
}

This is how you manage font substitution. Let us know in case of any issue.

Thanks for your Reply but if there is any way through which instead of replacing the fonts with the fonts we have , we can copy the original fonts at some path like local drive or azure containers and get it referred with help of some properties for ex. fontPath.

1 Like

@ashishk2909

We are investigating this scenario. Your investigation ticket ID is CONVERSIONNET-4741. You’ll be notified in case of any update.