472,128 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,128 software developers and data experts.

printing multiple pages, is there a better way to do this?

hi,

i need to print multiple pages on a printer. this is what i'm using now

Sub Print()
Dim PrintDoc As New PrintDocument
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText

Do While bPrintingNotDone
PrintDoc.Print()
Loop
End Sub

Sub PrintText(ByVal sender As System.Object, ByVal e As
PrintPageEventArgs)
'logic to parse the text and pages to print, setting bPrintingNotDone
to false terminates the print job
e.Graphics.DrawString(PrintString, Font, Brushes.Black, New
PointF(x,y))
End Sub

each page flashes a page-being-sent-to-the-printer message. i there a way to
format multiple pages for printing, and sending them to
print in one swoop, and getting only one such message?. i would actually
prefer not to get the page-being-sent-to-the-printer message at all. is
there a way to suppress it?

thanks, ray

please respond to the list
Nov 20 '05 #1
2 8077
Hi,

If you set e.hasmorepages to true in the print document it will call
the procedure to true and it will reuse the page being sent to print
message.
Sub Print()
Dim PrintDoc As New PrintDocument
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText

PrintDoc.Print()
End Sub

Sub PrintText(ByVal sender As System.Object, ByVal e As
PrintPageEventArgs)
'logic to parse the text and pages to print, setting bPrintingNotDone to false terminates the print job
e.Graphics.DrawString(PrintString, Font, Brushes.Black, New
PointF(x,y)) e.HasMorePages = Not bPrintingNotDone End Sub
Ken
-------------------
"ray well" <no****@nospam.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl... hi,

i need to print multiple pages on a printer. this is what i'm using now

Sub Print()
Dim PrintDoc As New PrintDocument
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText

Do While bPrintingNotDone
PrintDoc.Print()
Loop
End Sub

Sub PrintText(ByVal sender As System.Object, ByVal e As
PrintPageEventArgs)
'logic to parse the text and pages to print, setting bPrintingNotDone to false terminates the print job
e.Graphics.DrawString(PrintString, Font, Brushes.Black, New
PointF(x,y))
End Sub

each page flashes a page-being-sent-to-the-printer message. i there a way to format multiple pages for printing, and sending them to
print in one swoop, and getting only one such message?. i would actually
prefer not to get the page-being-sent-to-the-printer message at all. is
there a way to suppress it?

thanks, ray

please respond to the list

Nov 20 '05 #2
* "ray well" <no****@nospam.com> scripsit:
i need to print multiple pages on a printer. this is what i'm using now

Sub Print()
Dim PrintDoc As New PrintDocument
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText

Do While bPrintingNotDone
PrintDoc.Print()
Loop
End Sub

Sub PrintText(ByVal sender As System.Object, ByVal e As
PrintPageEventArgs)
'logic to parse the text and pages to print, setting bPrintingNotDone
to false terminates the print job
e.Graphics.DrawString(PrintString, Font, Brushes.Black, New
PointF(x,y))
End Sub


Why not create multiple pages as shown in this sample?

<http://www.mvps.org/dotnet/dotnet/samples/printing/downloads/PrintFramework.zip>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by ABF | last post: by
3 posts views Thread by John Sutor | last post: by
4 posts views Thread by Jay | last post: by
6 posts views Thread by Bill | last post: by
6 posts views Thread by Chris Dunaway | last post: by
reply views Thread by ben.agnoli | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.