I have PrintPageEvent
to print document in C# and I want to print text with align right. When the text starts with character, it prints normal. But if the text starts with number, data after printing is wrong.
Text to print: "Print a text" => Result: "Print a text"
Text to print: "10 test 8" => Result: "test 8 10"
What's wrong? Does anyone know it.
What I have tried:
I use this code line to print string
StringFormat stringFormat = new StringFormat();
stringFormat.FormatFlags = StringFormatFlags.DirectionRightToLeft;
e.Graphics.DrawString("10 test 8", new Font("Arial", 5), new SolidBrush(Color.Black), 10, 5, stringFormat);
If I remove StringFormat
function (print left to right), the printing is right.