I am building an windows form application that selects a relevant ID card design and then send that to the card printer.
I can print one card, or even multiple if choosing a specific Number of Copies in the printer printDialogBox, but how can I send a specific number of copies from my application? I get the total number required from a table in sql db, but now want to send this number as the Number of copies' to the printer, so the user does not have to in the printDialog1!
I'm using Visual Studio 2010 C#.
I have been searching but cannot find anything specific. There is a .Copies property which looks promising but I haven't worked out how to implement this into my existing code yet.
Code: Select all
private void PrintDesign()
{
// Sends job to printer
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
pd.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(printCard);
printDialog1.AllowSelection = true;
// ToDo: QUANTITY !!!
if (printDialog1.ShowDialog() == DialogResult.OK)
{
pd.Print();
}
}
private void printCard(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(designImg, 0, 0);
}