Free Support Forum - aspose.com

Correct usage of Char for Symbol Font

What is the correct VB API call usage for character 183 in the Symbol font?

I tried your posted example (from Fix 1.3.1.0 Released!);
[Visual Basic]

Dim pdf As Pdf = New Pdf()
Dim sec As Section = New Section(pdf)

pdf.Sections.Add(sec)

Dim text1 As Text = New Text(sec)
sec.Paragraphs.Add(text1)
Dim s1 As Segment = New Segment(text1)
s1.Content = ((Char)183).ToString()
s1.TextInfo.FontName = “Symbol”
text1.Segments.Add(s1)
Dim s2 As Segment = New Segment(text1)
s2.Content = " Industrial automation"
text1.Segments.Add(s2)

pdf.Save(Response)
Response.End()

The build error that I receive is that “Char is a type and so is not a valid expression.” I’ve tried looking at your demos on the same post, but they’re broken links.

I also tried:

dim char1 as char
s1.Content = ((char1 = “183”).ToString)
s1.TextInfo.FontName = "Symbol"

but I receive the following server error: “Using ‘builtin’ encoding instead of ‘winansi’ for font Symbol” What does that mean and how can I get this to work?

I would greatly appreciate any help.

Thank you.

Dear Brian,

Thanks for your report.

I have updated the links in https://forum.aspose.com/t/138267 since we have adjusted the folders on the server. Sorry about that.

forever will reply shortly regarding the issue you have reported.

Thanks for your patience.

Dear Brian,

Thanks for your consideration.

I have updated the code in https://forum.aspose.com/t/138267. The code should be:

Dim letter As Char = Microsoft.VisualBasic.ChrW(183)
s1.Content = letter

Sorry about that!

I’m still getting the same error as before. Am I not doing something correctly or is there something that I’m not adding in. Below is the code snipet I’m using;

Dim cell1 As Cell
cell1 = row1.Cells(0)
Dim text1Cell1 As Text
text1Cell1 = New Text(section2)
cell1.Paragraphs.Add(text1Cell1)
Dim segment As Segment
segment = New Segment(text1Cell1)
text1Cell1.Segments.Add(segment)
Dim letter As Char = Microsoft.VisualBasic.ChrW(183)
segment.Content = letter
segment.TextInfo.FontName = "Symbol"

And below is the complete error I’m receiving;

Server Error in ‘/’ Application.
--------------------------------------------------------------------------------

Using ‘builtin’ encoding instead of ‘winansi’ for font Symbol
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ApplicationException: Using ‘builtin’ encoding instead of ‘winansi’ for font Symbol

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ApplicationException: Using ‘builtin’ encoding instead of ‘winansi’ for font Symbol]
Aspose.Pdf.PdfText.t4.ParseTruetype(A4 textWriter, String fileName, String fontName, Int32 fontsPointer, Int32 enc, Boolean embed, Boolean isBold, Boolean isItalic) +2600
Aspose.Pdf.PdfText.a4.GetMetricsTruetype(A4 textWriter, Int32 fontsPointer, String fontName, Int32 enc, String fileName, Int32 embed, Boolean isBold, Boolean isItalic) +47
Aspose.Pdf.PdfText.U4.FindFont(A4 textWriter, String fontName, String encoding, Int32 embed, Boolean isBold, Boolean isItalic) +1241
Aspose.Pdf.PdfText.A4.FindFont(String editionName, String licenseName, String fontName, String encoding, Int32 embed, Boolean isBold, Boolean isItalic) +530
Aspose.Pdf.Xml.f7.ProcessSingleSegment(Pdf doc, Section currentPart, Table table, Row row, Cell cell, Text text, String content, AssignInfo assignInfo, X7 useType) +757
Aspose.Pdf.Xml.l7.ProcessText(Pdf doc, Section currentPart, Table table, Row row, Cell cell, Text text, AssignInfo assignInfo, X7 useType, Boolean isFirst) +1187
Aspose.Pdf.Xml.C7.ProcessCell(Pdf doc, Section currentPart, Table table, Row row, Cell cell, AssignInfo assignInfo) +774
Aspose.Pdf.Xml.a7.ProcessRow(Pdf doc, Section currentPart, Table table, Row row, AssignInfo assignInfo) +533
Aspose.Pdf.Xml.k7.ProcessTable(Pdf doc, Section currentPart, Table table, AssignInfo assignInfo, Boolean isFirst) +612
Aspose.Pdf.Xml.c7.ProcessSection(Pdf doc, Section section, AssignInfo assignInfo) +838
Aspose.Pdf.Xml.H7.AssignPages(Pdf doc) +308
Aspose.Pdf.Xml.J7.GenerateDocument(G6 gen, Pdf doc) +26
Aspose.Pdf.Pdf.Save(HttpResponse response) +45
AMI.print_profile.DesignProfile() +265
AMI.print_profile.Page_Load(Object sender, EventArgs e) +139
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Disregard that. I was using an older version of the DLL. Now that I am using 1.3.9.0, everything works fine!

Thanks again for your help.