473,692 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.PrintP age, AddressOf Me.PrintText

Do While bPrintingNotDon e
PrintDoc.Print( )
Loop
End Sub

Sub PrintText(ByVal sender As System.Object, ByVal e As
PrintPageEventA rgs)
'logic to parse the text and pages to print, setting bPrintingNotDon e
to false terminates the print job
e.Graphics.Draw String(PrintStr ing, 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 8189
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.PrintP age, AddressOf Me.PrintText

PrintDoc.Print( )
End Sub

Sub PrintText(ByVal sender As System.Object, ByVal e As
PrintPageEventA rgs)
'logic to parse the text and pages to print, setting bPrintingNotDon e to false terminates the print job
e.Graphics.Draw String(PrintStr ing, Font, Brushes.Black, New
PointF(x,y)) e.HasMorePages = Not bPrintingNotDon e End Sub
Ken
-------------------
"ray well" <no****@nospam. com> wrote in message
news:O6******** ******@tk2msftn gp13.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.PrintP age, AddressOf Me.PrintText

Do While bPrintingNotDon e
PrintDoc.Print( )
Loop
End Sub

Sub PrintText(ByVal sender As System.Object, ByVal e As
PrintPageEventA rgs)
'logic to parse the text and pages to print, setting bPrintingNotDon e to false terminates the print job
e.Graphics.Draw String(PrintStr ing, 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.PrintP age, AddressOf Me.PrintText

Do While bPrintingNotDon e
PrintDoc.Print( )
Loop
End Sub

Sub PrintText(ByVal sender As System.Object, ByVal e As
PrintPageEventA rgs)
'logic to parse the text and pages to print, setting bPrintingNotDon e
to false terminates the print job
e.Graphics.Draw String(PrintStr ing, 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1307
by: ABF | last post by:
Hello, I have a concern. I have created a small printing framework and it is taking a lot of memory. Simply put, the framework iterates through objects that implement a "printable" interfaces. Each object provides an image represented by a System::Drawing::Image*, the framework then "draws" these images on pages to print. Everything is done in memory, nothing comes from disk. I am using GDI+ classes to draw, and creating a printpreview
3
7176
by: John Sutor | last post by:
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.
4
3729
by: Jay | last post by:
Still can't seem to find a solution to printing a lengthy datagrid on multiple pages including datagrid headeron each page. I am not using Crystal Reports or Reporting Services or VStudio. Any idea how this can be done? Any links, examples Thanks a lot.
6
482
by: Bill | last post by:
Hi I am trying to get my listbox items to print if they stream past the one page mark. my code is working for one page of information (if the e.hasmorepages) is not there. But I am having trouble getting it to print on multiple pages. The second page will not print at all. Thanks in advance
6
4084
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if the user wants all pages will produce 3 pages. I want to offer the user the ability to select via the print dialog that only pages 1 and 2 of it are printed or possibly pages 1 and 3 but not 2. At the moment I can produce all three pages...
6
3241
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument (much like the current model), but my PrintDocument would have a Pages collection such that each time you need to have an additional page, you would just add another page to the collection and then use the page object for the actual drawing etc. ...
8
5890
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
0
1340
by: ben.agnoli | last post by:
I have written the below class for printing out large jpg files (1 page wide, multiple pages high) over multiple pages. The class will get instantiated multiple times at once by a windows service. For each page that the class prints, it gets visibly slower, when the third document, third page and onwards starts to print, it takes over 20 seconds a page, am I doing something wrong, or is this the wrong way to go about the task (could be...
0
2847
it0ny
by: it0ny | last post by:
Hi guys, thanks I am fairly new to this forum so I hope I chose the right place to post this question. I try to make my program printout a deposit's report. I created a class to store the printing printing data and the actual database data in a recordset. the class looks like this: Public Class BRPDD 'Balance Report PrintingDocument Data Public totalReceiptsNum As Integer Public totalLicFee As Double
0
8611
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8547
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8970
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8812
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8810
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7639
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4329
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4564
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2242
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.