Automatically Word-Wrapping Text To A Print Page?
Yes there is the DrawString has ability to word wrap the Text automatically. You can use MeasureString method to check wheather the Specified string can completely Drawn on the Page or Not and how much space will be required.
There is also a TextRenderer Class specially for this purpose.
Here is an Example:
Graphics gf = e.Graphics;
SizeF sf = gf.MeasureString("shdadj asdhkj shad adas dash asdl asasdassa",
new Font(new FontFamily("Arial"), 10F), 60);
gf.DrawString("shdadj asdhkj shad adas dash asdl asasdassa",
new Font(new FontFamily("Arial"), 10F), Brushes.Black,
new RectangleF(new PointF(4.0F,4.0F),sf),
StringFormat.GenericTypographic);
Here i have specified maximum of 60 Pixels as width then measure string will give me Size that will be required to Draw this string. Now if you already have a Size then you can compare with returned Size to see if it will be Drawn properly or Truncated
I found this : How to: Print a Multi-Page Text File in Windows Forms
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
int charactersOnPage = 0;
int linesPerPage = 0;
// Sets the value of charactersOnPage to the number of characters
// of stringToPrint that will fit within the bounds of the page.
e.Graphics.MeasureString(stringToPrint, this.Font,
e.MarginBounds.Size, StringFormat.GenericTypographic,
out charactersOnPage, out linesPerPage);
// Draws the string within the bounds of the page
e.Graphics.DrawString(stringToPrint, this.Font, Brushes.Black,
e.MarginBounds, StringFormat.GenericTypographic);
// Remove the portion of the string that has been printed.
stringToPrint = stringToPrint.Substring(charactersOnPage);
// Check to see if more pages are to be printed.
e.HasMorePages = (stringToPrint.Length > 0);
}