This is the output i get when i use DrawString.
I=Smith,John II=Johnson,Mark III=Anderson,James IV=William,Craig V=Ford,He...
page is a float datatype which value is based on e.PageSettings.Margins.Left;
e.Graphics.DrawString(Text, new System.Drawing.Font("Arial", 8F, FontStyle.Regular), Brushes.Black, page, 30);
In the above example, it is
e.Graphics.DrawString(Text, new System.Drawing.Font("Arial", 8F, FontStyle.Regular), Brushes.Black, page, 30);
I tried using this
StringFormat format = new StringFormat();
format.FormatFlags = StringFormatFlags.FitBlackBox;
e.Graphics.DrawString(Text, new System.Drawing.Font("Arial", 8F, FontStyle.Regular), Brushes.Black, page, 30, format);
How do i expand/word wrap so that i can have the entire words instead of '...' at the end?
I=Smith,John II=Johnson,Mark III=Anderson,James IV=William,Craig V=Ford,Henry
Select the image you want to wrap text around. The Format tab will appear on the right side of the Ribbon. On the Format tab, click the Wrap Text command in the Arrange group. Then select the desired text wrapping option.
The <wbr> element If you know where you want a long string to break, then it is also possible to insert the HTML <wbr> element. This can be useful in cases such as displaying a long URL on a page. You can then add the property in order to break the string in sensible places that will make it easier to read.
If you want to prevent the text from wrapping, you can apply white-space: nowrap; Notice in HTML code example at the top of this article, there are actually two line breaks, one before the line of text and one after, which allow the text to be on its own line (in the code).
You can "word wrap" the text by using a bounding rectangle.
Use Graphics.DrawString Method (String, Font, Brush, RectangleF, StringFormat)
The RectangleF specifies the draw area and it will automatically "wrap" your text for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With