日期:2014-05-17 浏览次数:21357 次
public PrintDocument pdDocument;
public PageSetupDialog dlgPageSetup;
public PrintPreviewDialog ppd;
public PrintDialog pd;
private string[] lines;
public string[] Lines
{
get
{
if (ViewState["Lines"] != null)
return ViewState["Lines"] as string[];
return null;
}
set
{
lines = value;
ViewState["Lines"] = lines;
}
}
public PrintHelper()
{
pdDocument = new PrintDocument();
dlgPageSetup = new PageSetupDialog();
ppd = new PrintPreviewDialog();
pd = new PrintDialog();
dlgPageSetup.Document = pdDocument;
pd.Document = pdDocument;
ppd.Document = pdDocument;
pdDocument.PrintPage += new PrintPageEventHandler(pdDocument_PrintPage);