Printing a Document

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using the PrintPageEventArgs with the Graphics namespace, and when the
code gets to the point where it sets HasMorePages to true, it loops in a
while loop to being the new page. The problem is that all of the next page
still prints on the first page. I can't figure out why this is. I'm using
rectangles to help align my spacing and to create certain section of the page
(b/c its a form). Anyone have any suggestions? Ask me questions if you need
more info.

Thanks!!
 
You have to think to the pages as contiguous, and adjust the vertical
coordinates accordingly. So for example the vertical offset of the first
page is 0, for the second page is ev.MarginBounds.Height, and so on.
 
You have to exit the OnPrintPage handler to cause a page eject with
HasMorePages true if you will be printing more data. You will need to keep
your printing position variables outside of this routine so that it will
work when re-entered.

Ron Allen
 
Back
Top