PrinterSettings.PrintRange, print only selected pages.

G

Guest

Hi, can anyone help me with the printrange functionality?

The problem is: whatever I try allways all the pages are print (directly to
the printer or via a preview control).

The VS-Build in help suggests checking the Printdocument.PrintPage event
during printing. And indeed I can check if the current page in the Printpage
event should be printed or not. But HOW to cancel the current page, if the
page should not be printed, rather than the printjob? I don't want blanc
pages.

Regards Coen.
 
R

Ron Allen

Coen,
Try putting some logic in the PrintPage event that will advance to the
next page if the page # is not in range before starting to draw the page.
And, of course, make sure to exit when no more pages are available. This is
how I do partial page range printing (although my exclusions are based on
page type normally). I just have a PrintPage event that manages the page
selection and doesn't do any drawing and then farms out the drawing to a
seperate method in the class.

Ron Allen
 
G

Guest

Hi Ron, thanks for response.
The thing I don't understand is:

' Try putting some logic in the PrintPage event that will advance to the
next page if the page # is not in range before starting to draw the page.'

Not drawing the current page still causes a blank page. How to take care
that some pages (the not selected pages) are not created?

Coen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top