Test code
Arabic text moved to the start of the line after saving.
// Read the source text file
TextReader tr = new StreamReader("C:\\logArabic.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");
// Add a new text paragraph in paragraphs collection and pass the TextFragment object
page.Paragraphs.Add(text);
// Save resultant PDF file
doc.Save("C:\\TexttoPDF_out.pdf");
logArabic.zip (236 Bytes)