Error happened during parsing \u0002 error when the following:
TextParagraph para = new TextParagraph();
para.AppendLine(“Hello”);
Build::
Apsose.Pdf v17.11.0.0 through Nuget Package
Error happened during parsing \u0002 error when the following:
TextParagraph para = new TextParagraph();
para.AppendLine(“Hello”);
Build::
Apsose.Pdf v17.11.0.0 through Nuget Package
We have tried your lines of code with the latest version 17.11.0 of Aspose.Pdf for .NET API and could not replicate the said error in our environment. Kindly create a small project application which reproduces this error in your environment, and then share a Zip of this project. We will investigate and share our findings with you.
I seem to have trouble loading any type of text into TextFragment… It seems to happen on my Windows Server 2008 R2/ Windows Server 2012 R2. It fails on an interop SEH Exception when i load up Aspose.Pdf.Document.
When I load any string into TextFragment constructor, it throws an excpeption. Following the stack trace it seems that Aspose.PDF.TextFragment is searching for something in fonts it cant find by default. Is there some default font that is required downstream to the textfragment constructor? I can create a TextSegment, but the assignment to textFragment then throws the same error.
Stack Trace:
at . (Int32 , Int32& )
at .()
at .()
at . ( )
at .( )
at .( )
at Aspose.Pdf.Text.FontRepository.FindFont(String fontName)
at Aspose.Pdf.Text.TextFragment.(String )
at Aspose.Pdf.Text.TextFragment…ctor(String text)
at Aspose.Pdf.Text.TextParagraph.AppendLine(String line, TextState textState, Single lineSpacing)
at Aspose.Pdf.Text.TextParagraph.AppendLine(String line, TextState textState)
Aspose.PDF API retrieves the default font directory of the Operating System, and you can add and remove font directories. Please set font directory with the following lines of code, and then let us know how that goes into your environment.
C#
string dataDir = @"C:\Pdf\test326\fonts\";
var fs = new Aspose.Pdf.Text.FolderFontSource(dataDir);
FontRepository.Sources.Add(fs);
FontRepository.FindFont(@"FontAwesome", true);
I tried this and can find the font i need… “FontAwesome” doesnt exists… but the repos load fine… its when i get to the TEXTFRAGMENT constructor that fails while climbing the stack into your contructor
Kindly create a small project and make sure that the error is reproducible in your environment, and then send us a ZIP of this project. We will investigate and share our finds with you.
I have Paid Support Ticket Open for this now, thanks for your help