Setting the paper size

Posted by rajaneesh on Stack Overflow See other posts from Stack Overflow or by rajaneesh
Published on 2009-03-26T07:20:34Z Indexed on 2012/09/29 21:38 UTC
Read the original article Hit count: 302

Filed under:
|
|

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();

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET