using System.Drawing.Printing;
using System.Drawing; private void Test()
{
PrintDocument m_pdoc = new PrintDocument();
PaperSize psz = new PaperSize();
m_pdoc.PrinterSettings.PrinterName = "Microsoft Office Document Image Writer";
psz.RawKind = ;// Printing.PaperKind.Custom此枚举的值是0
psz.Width = ;
psz.Height = ;
m_pdoc.DefaultPageSettings.PaperSize = psz; //设置纸张大小
m_pdoc.PrintPage += new PrintPageEventHandler(prn_PrintPage);
m_pdoc.Print();
}