code run but printer
print blank page
var files = Directory.GetFiles(Server.MapPath("/Document"));
if (files.Length != 0)
{
using (var pdoc = new PrintDocument())
using (var pdi = new System.Windows.Forms.PrintDialog { Document = pdoc, UseEXDialog = false })
{
// pdoc.PrinterSettings.PrinterName ="" ;
pdoc.PrinterSettings = pdi.PrinterSettings;
// ************************************
// Pay attention to the following line:
pdoc.PrintPage += pd_PrintPage;
// ************************************
foreach (var file in files)
{
pdoc.DocumentName = file;
pdoc.Print();
}
}
}