Free Support Forum -

Junk characters while writing text into a PDF

We recently bought the Aspose.PDF license and as part of testing, we found that some text is not rendering properly. I confirmed that “Arial Unicode MS” exist under C:\Windows\Fonts and application runs without any error.

Please find the test code. I used the below-attached text file.

// Read the source text file
TextReader tr = new StreamReader(“C:\log.txt”);

            // Instantiate a Document object by calling its empty constructor
            Document doc = new Document();

            // Add a new page in Pages collection of Document
            Page page = doc.Pages.Add();

            // Create an instance of TextFragmet and pass the text from reader object to its constructor as argument
            TextFragment text = new TextFragment(tr.ReadToEnd());

            text.TextState.Font = FontRepository.FindFont("Arial Unicode MS");

            // Add a new text paragraph in paragraphs collection and pass the TextFragment object

            // Save resultant PDF file
            doc.Save("C:\\TexttoPDF_out.pdf"); (675 Bytes)

Kindly address this with high priority.


Thank you for contacting support.

We have worked with the data shared by you and have been able to reproduce the issue in our environment. A ticket with ID PDFNET-44978 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.