I am trying to get new line but if I use \n
it does not help any way to have new line by adding something to string like \r\n
(does not work)
gfx.DrawString("Project No \n" + textBoxProjNumber.Text, fontUnder, XBrushes.Black, 230, 95);
does not work.
This is what I did that does not involve using the Rect class:
I had a defined right lateral limit and determined whether the current string would be larger than the set bounds. If it was, I wrote it. Otherwise, I continued adding to it.
I know I'm late to this question but I hope it can help someone.
Have you tried the XTextFormatter class?
See here: http://www.pdfsharp.net/wiki/TextLayout-sample.ashx
Code snippet: