Free Support Forum - aspose.com

HelveticaNeue LT 85 Heavy - not supported

Hello,


I am using the latest version of ASPOSE.PDF and noticed that the font HelveticaNeue LT 85 Heavy is not supported. Is there a way for me to use this font?

Thanks

Hi Sonu,

We’re sorry for the delay in getting back to you on this one.

A support representative will be with you shortly to guide you appropriately.


Hi Sonu,


Thanks for your inquiry. As your font is not a supported font, you can try embedding your font in your PDF document. Please check the following articles for details and sample code regarding font embedding. Hopefully it will help you to fix the issue. If issue persist then please share your font file and sample code, so we will test the scenario at our end and will provide you more information accordingly.



We are sorry for the inconvenience caused.


Best Regards,

Hi,


I have tried this but it doesnt work. Here is the error message:

The Font ‘HelveticaNeue LT 85 Heavy’ is not found. This font is not supported.

I set the font on the pdf using:

pdf.TextInfo.IsFontEmbedded = true;
pdf.TextInfo.FontName = “HelveticaNeue LT 85 Heavy”;

And on the individual textinfo inside a table cell:

TextInfo info = new TextInfo
{
FontSize = fontSize,
CharSpace = 0,
Color = new Color(color),
FontName = “HelveticaNeue LT 85 Heavy”,
//FontName = “Helvetica-Bold”,
IsFontEmbedded = true
};

Attached is the font for you.

Hi Sonu,

Thank you for sharing font file. We have installed the font and tested the scenario with the latest version of Aspose.Pdf for NET 8.8.0, We have managed to reproduce the reported issue and logged it in our bug tracking system as PDFNEWNET-36270 for further investigation and resolution. We will notify you via this thread as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

Hi Sonu,


In reference to the ticket ID PDFNET-36270, please use the new DOM approach of Aspose.Pdf for .NET API. It is enough to connect the desired font by calling OpenFont method of the FontRepository class. The following code snippet creates a PDF document with font “Helvetica Neue LT 85 Heavy” from ttf font file “LTe50267.ttf”. An output PDF of the code is attached to this reply.

[.NET, C#]
<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>//open document<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
Document pdfDocument = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”> Document();<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>//get particular page<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
Page pdfPage = pdfDocument.Pages.Add();<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>//create text fragment<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
TextFragment textFragment = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”> TextFragment(“New appended text”);<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>textFragment.Position = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”> Position(280, 700);<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>//set text properties<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
textFragment.TextState.FontSize = 12;<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
textFragment.TextState.Font = FontRepository.OpenFont(myDir + “LTe50267.ttf”);<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
textFragment.TextState.BackgroundColor = Aspose.Pdf.Color.Parse(“LightGray”);<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
textFragment.TextState.ForegroundColor = Aspose.Pdf.Color.Parse(“Red”);<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// create TextBuilder object<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
TextBuilder textBuilder = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”> TextBuilder(pdfPage);<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// append the text fragment to the PDF page<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
textBuilder.AppendText(textFragment);<br style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”><span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>//save document<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>
pdfDocument.Save(myDir + “output.pdf”);
<span style=“font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre; background-color: rgb(255, 255, 255);”>

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan