Good morning. I have to print some long strings that falls off the margins of my page. I'm not able to split automatically as a multi-line string.
private void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
...
string line ="Condimentum a a ac aenean parturient risus suscipit et orci scelerisque convallis porttitor enim venenatis viverra.Egestas nibh natoque mus etiam a parturient feugiat hendrerit a sagittis viverra dui ante varius lectus arcu."
float leftMargin = ev.MarginBounds.Left;
float topMargin = ev.MarginBounds.Top;
ev.Graphics.DrawString(line, printFont, Brushes.Black, new RectangleF(leftMargin, yPos, 400.0f, 200.0f));
...
}
I tried using the overload with the bounding box specification, as you can see, but the result is a jam of chars on the page, because the lines from the long string is printed over itself.
Is there a quick way to solve this problem?
Thanks