MultiRow 打印
MultiRow 打印时得调用PageSetup方法,打开页面设置纸张、打印方向和页边距。我想是否可以通过代码设置好这些内容,而不需要每一次都调用PageSetup方法打开设置窗口来设置。
求大神指点 var printDocument = new System.Drawing.Printing.PrintDocument();
PaperSize a4Paper = null;
for (int i = 0; i < printDocument.PrinterSettings.PaperSizes.Count; i++)
{
if(printDocument.PrinterSettings.PaperSizes.Kind == PaperKind.A4)
{
a4Paper = printDocument.PrinterSettings.PaperSizes;
break;
}
}
printDocument.DefaultPageSettings.PaperSize = a4Paper;
printDocument.DefaultPageSettings.Landscape = false;
gcMultiRow1.Document = printDocument; 核心代码就是
var printDocument = new System.Drawing.Printing.PrintDocument();
// 设置printDocument.DefaultPageSettings 属性
printDocument.DefaultPageSettings.Landscape = false;
gcMultiRow1.Document = printDocument;
页:
[1]