參考引用:
--
using System.Drawing.Printing.PrintDocument
using System.Drawing.Printing.PrinterSettings.PaperSizeCollection
using System.Drawing.Printing.PaperSize
using System.Drawing.Printing.PageSettings
/////////需要以上引用
PrintDocument pd = new PrintDocument();
PaperSize p=null;
foreach(PaperSize ps in pd.PrinterSettings.PaperSizes)
{ if(ps.PaperName.Equals("A3"))
p = ps;
}
pd.DefaultPageSettings.PaperSize = p;
pd.Print();
指定:
pd.DefaultPageSettings.PaperSize = new PaperSize("自定义名称",宽,长)
沒有留言:
張貼留言