Setting the paper size
- by rajaneesh
Please help me how to set paper size in c# code . i am using api printDocument ..
my code is
ppvw = new PrintPreviewDialog();
ppvw.Document = printDoc;
ppvw.PrintPreviewControl.StartPage = 0;
ppvw.PrintPreviewControl.Zoom = 1.0;
ppvw.PrintPreviewControl.Columns = 10;
// Showing the Print Preview Page
printDoc.BeginPrint += new System.Drawing.Printing.PrintEventHandler(PrintDoc_BeginPrint);
printDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(PrintDoc_PrintPage);
if (ppvw.ShowDialog() != DialogResult.OK)
{
printDoc.BeginPrint -= new System.Drawing.Printing.PrintEventHandler(PrintDoc_BeginPrint);
printDoc.PrintPage -= new System.Drawing.Printing.PrintPageEventHandler(PrintDoc_PrintPage);
}
printDoc.PrinterSettings.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("a2", 5.0,5.0);
printDoc.Print();