日期:2014-05-20 浏览次数:21174 次
System.Drawing.Printing.PrintDocument doc = new System.Drawing.Printing.PrintDocument();
//记录标识自定义纸张的ID
int rawKind = 1;
//枚举出所有的打印纸尺寸
for (int a = 0; a < doc.PrinterSettings.PaperSizes.Count; a++)
{
if (doc.PrinterSettings.PaperSizes[a].PaperName == "wms")
{
rawKind = doc.PrinterSettings.PaperSizes[a].RawKind;
//指定纸张,下面代码的crystalReport所设计的报表定义的对象
Print.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)rawKind;
break;
}
}