Solved

Forcing a new page in vb.net

Posted on 2004-03-29
2
664 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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now