Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Forcing a new page in vb.net

Posted on 2004-03-29
2
Medium Priority
?
688 Views
Last Modified: 2008-02-01
I am creating ID cards in vb.net. The cards will be printed on both sides, and I will be printing a variable number of lines on the front of the card. How do I go about forcing a new page (or a formfeed) to begin printing on page 2?? I have tried to use vbFormFeed in a e.graphics.DrawString, but it merely draws a square on the page where I want the formfeed to occur.

Any help would be greatly appreicated.
0
Comment
Question by:rcg112355
2 Comments
 
LVL 12

Accepted Solution

by:
farsight earned 750 total points
ID: 10710878
How are you currently printing pages?

Are you using something like this?

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object,
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage

If so, this might help.
http://www.dotnet247.com/247reference/msgs/35/178404.aspx

The important thing is PrintPage should only print a single page.  Set e.HasMorePages to True if there are more pages to be printed.  PrintPage will be called again to print the next page.  Your code will have to keep track of which page you're on, and print the appropriate page.  Set e.HasMorePages to False if the document is completely done.

If you're using some completely different method to print pages, please tell us.
0
 

Author Comment

by:rcg112355
ID: 10754541
That method does work, but I just can't believe there isn't a way to send control codes directly to the printer in vb.net. This method did get the job done. I guess that this old dog has to learn some new tricks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question