Free Support Forum - aspose.com

Pdf.net not recognizing TrueType fonts

I'm trying to use a true type font, but it doesn't recognize any true type font. If I use the line with font=Symbol, it works fine. But, if I use the Wingdings font, I get the default font.

Aspose.Pdf.TextInfo tfChangeFont = new Aspose.Pdf.TextInfo();
tfChangeFont.FontName = "Symbol";
//tfChangeFont.FontName = "Wingdings";
tfChangeFont.FontSize = 12;

Text ChangeFontLine = new Text("Test Font Change",tfChangeFont);
invPage.Paragraphs.Add(ChangeFontLine);

Using Symbol: This is a test

Using Wingdings: This is a test

I have confirmed that the font is in my windows system font directory.

Hello Judy,

Thanks for using our products.

I have tested the scenario with the code snippet that you have shared and using Aspose.Pdf for .NET 4.4.0 and I am unable to notice any problem. Please find attached the resultant PDF that I have generated.

[C#]

Pdf pdf = new Pdf();
Aspose.Pdf.Section sec1 = pdf.Sections.Add();
Aspose.Pdf.TextInfo tfChangeFont = new Aspose.Pdf.TextInfo();
// tfChangeFont.FontName = "Symbol";
tfChangeFont.FontName = "Wingdings";
tfChangeFont.FontSize = 12;
Text ChangeFontLine = new Text("This is a test", tfChangeFont);
sec1.Paragraphs.Add(ChangeFontLine);
pdf.Save(@"d:/pdftest/TrueTypeFont_Test.pdf");

Can you please share which version of Aspose.Pdf for .NET you are using ?

We apologize for your inconvenience.

I'm using Aspose.Pdf for .NET 4.4.0 (net4.0_ClientProfile dll) and VisualStudio 2010.

I ran the code using VisualStudio 2008 and Aspose.Pdf for .NET 4.4.0 (net3.5 dll) and it ran correctly.

Hello Judy,

Thanks for sharing the information.

I have tested the scenario using Aspose.Pdf for .NET 4.4.0 (net4.0_ClientProfile) in Visual Studio 2010 and I am able to notice the same problem. Meanwhile I have also tested the scenario using the latest release version of Aspose.Pdf for .NET (which will be published sometimes soon) and I am unable to notice this problem. Please be patient and spare us little time. Once the latest release version becomes available, we would be pleased to update you with the status of correction.

Your patience and comprehension is greatly appreciated in this regard. We apologize for your inconvenience.

Hello Judy,

Thanks for your patience.

We are pleased to announce the release of Aspose.Pdf for .NET 4.5.0. Please download it from this link. In case you face any problem, please feel free contact.