I look across the same problem and not cycled you I can not explain why it happens because I did the same thing you thought was right and nothing ever went wrong I had something similar to yours and watch this code that I'm going to spend my problems you can resolve what happened so it can not find the link as the link that I found so leave the code because I use something similar on StringBuilder underside of a string and I also add a Rectangle for Print manipulate space but what is important and what you need is in this part focus:
Code:
Font font = new Font ("Arial", 12);
CharactersUsed int = 0;
LinesUsed int = 0;
Rectangle area = new Rectangle (e.MarginBounds.X, e.MarginBounds.Y + 100, e.MarginBounds.Width, e.MarginBounds.Height - 100);
AddTitle (e, "Title", Space);
e.Graphics.MeasureString (Text.ToString (), Font, Space.Size, StringFormat.GenericTypographic, CharactersUsed out, out LinesUsed)
e.Graphics.DrawString (Text.ToString (), Font, Brushes.Black, Space, StringFormat.GenericTypographic)
Texto.Remove text = (0, CharactersUsed)
e.HasMorePages = (Text.Length> 0);
AddFooter (e, Space, PageCounter, "dd / mm / yy", "00:00");
PageCounter + +;
This is correct, it works perfectly, however as I do not understand you because if you declare a global variable which increases to stop the event PrintDocument and e.HasMorePage = false, because you can not. I hope someone can say that happens, just as you commented the code that i put you up and running as I achieved this after a lot but I still do not understand 100% the performance of HasMorePages.
Bookmarks