TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
patrick
NA
397
0
Printing more than one page
Sep 11 2009 10:46 AM
I currently use the code:
private void Print()
{
string PrinterName =
PrintLocationDataHandler.getPrinterName("Reports");
PrintDocument PD = new PrintDocument
();
PD.PrinterSettings.PrinterName = PrinterName;
PD.PrintPage += new
PrintPageEventHandler(PD_PrintPage);
PD.Print();
}
void PD_PrintPage(object sender, PrintPageEventArgs e)
{
String textToPrint = richTextBox1.Text;
Font printFont = new Font("Courier New", 12, FontStyle.Bold);
e.Graphics.DrawString(textToPrint, printFont, Brushes.Black, 0, 0);
}
private void button1_Click(object sender, EventArgs e) {
Print();
}
The problem i am running into is that when it hits a new page, it just stops. I assumed the printer would automatically know when to start a new page, but it doesnt. I am printing directly from a rich text box.
Reply
Answers (
2
)
how to keep username globally
write to selected (active? focused?) textbox