I have a problem with converting .txt files to .pdf using Aspose.Total (version 18) for C#.
When I convert a .tx file to PDF using Danish encoding, the size and font of the text will be changed in the PDF file.
TextReader tr = new StreamReader(fileInfo.FullName, Encoding.GetEncoding(“iso-8859-1”));
var doc = new Aspose.Pdf.Document();
var page = doc.Pages.Add();
var text = new TextFragment(tr.ReadToEnd());
page.Paragraphs.Add(text);
doc.Save(memoryStream);
You can set text properties, including font, color and size with TextState member of the TextFragment instance. Please refer to this help topic: Add text to PDF document
We managed to replicate the said issue in our environment. It has been logged under the ticket ID PDFNET-44822 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.
The bug logged under the ticket ID PDFNET-44822 is pending for the analysis and not resolved yet. We will investigate as per the development schedules, and notify you once it is fixed.