J
Jason James
Hi all,
I have an application that needs to print numerous
documents of different styles (either to the printer
or print preview dialog).
I have selected which document type to print by
using a select statement in the the
PrintDocument.PrintPage
event handler. This appears to work very well until
I try and print a document with multiple pages.
When I set
e.HasMorePages = TRUE,
the event fires the PrintPage event but the subroutine
that handles the actual rendering is not called a second time.
If I move the rendering code into the PrintPage event
handler (so only one format of page can be printed) then
everything seems to work OK.
Here is all of the code that is containted in the
PrintDocument.PrintPage event handler
nThisLabel = 0
' LabelType is an enum.
Select Case LabelType
Case LabelTypes.AlphaSnap
PrintOutlets(e)
Case LabelTypes.AlphaSnap12Port
PrintAlphaSnap12Port(e)
Case LabelTypes.AlphaSnap16Port
PrintAlphaSnap16Port(e)
Case LabelTypes.AlphaSnap24Port
PrintAlphaSnap24Port(e)
End Select
Is there a better way to decide which document to render
that will not cause this unwanted functionality in my
program and multi-page documents will be printed correctly?
Many thanks,
Jason.
I have an application that needs to print numerous
documents of different styles (either to the printer
or print preview dialog).
I have selected which document type to print by
using a select statement in the the
PrintDocument.PrintPage
event handler. This appears to work very well until
I try and print a document with multiple pages.
When I set
e.HasMorePages = TRUE,
the event fires the PrintPage event but the subroutine
that handles the actual rendering is not called a second time.
If I move the rendering code into the PrintPage event
handler (so only one format of page can be printed) then
everything seems to work OK.
Here is all of the code that is containted in the
PrintDocument.PrintPage event handler
nThisLabel = 0
' LabelType is an enum.
Select Case LabelType
Case LabelTypes.AlphaSnap
PrintOutlets(e)
Case LabelTypes.AlphaSnap12Port
PrintAlphaSnap12Port(e)
Case LabelTypes.AlphaSnap16Port
PrintAlphaSnap16Port(e)
Case LabelTypes.AlphaSnap24Port
PrintAlphaSnap24Port(e)
End Select
Is there a better way to decide which document to render
that will not cause this unwanted functionality in my
program and multi-page documents will be printed correctly?
Many thanks,
Jason.