Want to build the ChatGPT based Apps? Start here
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
patrick
0
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