Solved

Forcing a new page in vb.net

Posted on 2004-03-29
2
674 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 250 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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