Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I created a application to print the invoice and challan. so generally invoice paper size is "A4" and Challan paper size is "custom".
So, When I set the paper size "A4", its print fine... but when i want to print custom paper size then it print different, from others printer and it print the multiple pages.

My code is :-
C#
DialogResult dr = MessageBox.Show("Do You Want to Print?", "Print", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
   if (dr == DialogResult.Yes)
   {
       printDocument1.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 670, 846);
       printDocument1.PrinterSettings.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 670, 846);                    
       printDocument1.Print();                        
   }


It happens on "HP Leserjet 1015" printer Only...
Thanks in advanced..
Posted
Comments
tumbledDown2earth 14-Apr-13 9:40am    
Check you driver details from your manual .. may be there is a hint there
JayantaChatterjee 14-Apr-13 10:09am    
what will I check from driver manual??
but this happens only with my software, otherwise its good.

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