Click here to Skip to main content
16,016,165 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i have 2 question :

1- how can i print a doument more than once ?

2- i have 2 printer printer no1 connect to my computer and another one is in my network
ho can i print a document in 2 printer ?

thanks

this is my code :

C#
 String drawString = "Sample  Text";

            // Create font and brush.
            Font drawFont = new Font("Arial", 16);
            SolidBrush drawBrush = new SolidBrush(Color.Black);

            // Create rectangle for drawing. 
            float x = 350.0F;
            float y = 150.0F;
            float width = 200.0F;
            float height = 50.0F;
            RectangleF drawRect = new RectangleF(x, y, width, height);

            // Draw rectangle to screen.
            Pen blackPen = new Pen(Color.Red);
            e.Graphics.DrawRectangle(blackPen, x, y, width, height);

            // Draw string to screen.
            e.Graphics.DrawString(drawString, drawFont, drawBrush, drawRect);
            e.Graphics.DrawString(this.textBox5.Text, this.textBox1.Font, Brushes.Black, 10, 25);



private void button6_Click(object sender, EventArgs e)
        {
printdocument1.print;
}
Posted

1 solution

1) Set the PrintDocument.PrinterSettings.Copies to the number of copies you want.
2) You would need to create a second PrintDocument and select the other printer: you can't send the same object to two devices simultaneously as far as I know. You may be able to reuse the same PrintDocument object if you wait for the print to complete first (But I'd use a second myself).
 
Share this answer
 
Comments
itman2 17-Feb-15 14:41pm    
thanks

but how can i select other printer in network ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900