469,632 Members | 1,639 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,632 developers. It's quick & easy.

Printing with multiple pages

Does anyone know how to print multiple page documents? I can print from a
test box or a one page document, but not one with multiple pages.
Nov 16 '05 #1
3 6916
Set the HasMorePage Property to true, in the PrintEvent

"John Sutor" wrote:
Does anyone know how to print multiple page documents? I can print from a
test box or a one page document, but not one with multiple pages.

Nov 16 '05 #2
Set the HasMorePage Property to true, in the PrintEvent

"John Sutor" wrote:
Does anyone know how to print multiple page documents? I can print from a
test box or a one page document, but not one with multiple pages.

Nov 16 '05 #3
John,
There are some examples in the VS projects. In short you use a
PrintDocument subclass and keep the datastream position either in a class
variable for that subclass or, if you are just providing OnPrintPage
handling to the standard PrintDocument, in a class variable. Everytime you
get to the bottom of the page and there is more data set HasMorePages to
true and return. If you are going to use print preview and printing make
sure to handle OnBeginPrint and reset the position of your print stream back
to the beginning there so it can print to the printer from the preview if
desired.
I've found it easiest to make a complete subclass of PrintDocument and
implement OnBeginPrint, OnEndPrint, and OnPrintPage for all my documents. I
store my data stream and the current position in class variables. I
allocate all my custom Fonts and Pens in OnBeginPrint and then deallocate
them in OnEndPrint. If you have documents that change orientation within
them you can implement OnQueryPageSettings as well.

Ron Allen

"John Sutor" <jo********@cinfin.com> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to print multiple page documents? I can print from a
test box or a one page document, but not one with multiple pages.

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Jeff B. | last post: by
4 posts views Thread by Jay | last post: by
6 posts views Thread by Bill | last post: by
reply views Thread by ben.agnoli | last post: by
18 posts views Thread by Brett | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.