I have a print button & when i click on that print button, i.e. every time while printing, the printer opens the printer settings it takes paper size letter by default. I want to adjust that paper size to a defined size by code & it should print automatically. I have found something but that is not reliable........Can anybody help me.

Try this to set the paper size you may also check this link it contains source code of application to print on custom sized page

private PrintDocument printDoc;
//rest of code
printDoc.PrinterSettings.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("a2", 5.0,5.0);
//rest of code
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.