Sometimes I want to skip a page - How to do that

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

In the handler QueryPageSettings I let the user select a "Skip This Page"
option.

But I don't know how to handle it if he does.

I can set a flag and in PrintPage skip printing the page but the page count
in Printer and Faxes still increments.

I can cancel the entire print job but can not find anything that will enable
me to skip one page.


Anyone know how?
 
* " Just Me said:
In the handler QueryPageSettings I let the user select a "Skip This Page"
option.

But I don't know how to handle it if he does.

I can set a flag and in PrintPage skip printing the page but the page count
in Printer and Faxes still increments.

I can cancel the entire print job but can not find anything that will enable
me to skip one page.

Just don't print the page. How to prevent printing strongly depends on
how you handle printing of the pages.
 
Herfried K. Wagner said:
Just don't print the page. How to prevent printing strongly depends on
how you handle printing of the pages.

Not sure what you mean. I now in PrintPage only bump my page number variable
and exit.

But the system must consider the fact that PrintPage is entered its a page
(I guess a blank one, I never checked).

Unless someone knows how to tell the system not to add a page to the print
document I'll have to try do it all in QueryPageSettings (but that's not
without a problem). I wish I could in QueryPageSettings or in PrintPage tell
the system not to add this page to the output.

To illustrate the problem think of a 10 page document. For each page, in
QueryPageSettings I ask the user if he want to print the page. Say he does
for the first 9 pages but on page 10 he says not to print page 10. I don't
know what to do. As soon as I exit, PrintPage will get called and if I do
nothing in PrintPage a blank page gets added to the document.


Any ideas how avoid that?


 
* " Just Me said:
Not sure what you mean. I now in PrintPage only bump my page number variable
and exit.

But the system must consider the fact that PrintPage is entered its a page
(I guess a blank one, I never checked).

Unless someone knows how to tell the system not to add a page to the print
document I'll have to try do it all in QueryPageSettings (but that's not
without a problem). I wish I could in QueryPageSettings or in PrintPage tell
the system not to add this page to the output.

To illustrate the problem think of a 10 page document. For each page, in
QueryPageSettings I ask the user if he want to print the page. Say he does
for the first 9 pages but on page 10 he says not to print page 10. I don't
know what to do. As soon as I exit, PrintPage will get called and if I do
nothing in PrintPage a blank page gets added to the document.

In 'PrintPage', you can do something like that:

\\\
Private m_NextPageToPrint As Integer

Private Sub MyPrintDocument_PrintPage(...) Handles ...
Select Case m_NextPageToPrint
Case 1
e.Graphics.DrawString(...)
Case 2
e.Graphics.DrawString(...)
Case 3
...
Case 4
...
End Select
e.HasMorePages = ShouldNextPageBePrinted(...)
End Sub

Private Function ShouldNextPageBePrinted(...) As Boolean
If ... Then
...
m_NextPageToPrint = 4
...
Return True
Else
Return False
End If
End Function
///
 
That looks good. I'd also have to do something in case the first (few)
page(s) are not printed.

Thanks a lot
 
Back
Top