- var printDocument = new System.Drawing.Printing.PrintDocument();
- PaperSize a4Paper = null;
- for (int i = 0; i < printDocument.PrinterSettings.PaperSizes.Count; i++)
- {
- if(printDocument.PrinterSettings.PaperSizes[i].Kind == PaperKind.A4)
- {
- a4Paper = printDocument.PrinterSettings.PaperSizes[i];
- break;
- }
- }
- printDocument.DefaultPageSettings.PaperSize = a4Paper;
- printDocument.DefaultPageSettings.Landscape = false;
- gcMultiRow1.Document = printDocument;
复制代码 |