PDFsharp & MigraDoc Foundation https://forum.pdfsharp.net/ |
|
Text aligned in a rectangle https://forum.pdfsharp.net/viewtopic.php?f=2&t=2428 |
Page 1 of 1 |
Author: | Thomas Hoevel [ Wed May 08, 2013 9:17 am ] |
Post subject: | Re: Text aligned in a rectangle |
Hi! You have to use XTextFormatter to get more than a single line automatically. With gfx.DrawString you will always get a single line only. Link to sample code: http://www.pdfsharp.net/wiki/TextLayout-sample.ashx |
Author: | saks07 [ Wed May 08, 2013 9:48 am ] |
Post subject: | Re: Text aligned in a rectangle |
I get the same result, the text is not alligned in the rectangle, is in one line and it's out of page bounds like in the picture i posted. In the Xtextformatter example you have a const string text variable which has a defined string length in every row or has ("\n") to jump in a new line, otherwise I get the string from a rich text box which has word wrap enabled |
Author: | Thomas Hoevel [ Wed May 08, 2013 11:47 am ] |
Post subject: | Re: Text aligned in a rectangle |
XTextFormatter breaks lines only at spaces. Use useful test text and it'll work. Or modify XTextFormatter to your needs. |
Author: | saks07 [ Wed May 08, 2013 2:52 pm ] |
Post subject: | Re: Text aligned in a rectangle |
It works. Thanks a lot for your support Regards, saks07 |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |