我正在使用以下代码使用PrintDocument类:
printDocument.PrintPage += (s, ev) =>
{
ev.Graphics.DrawImage(bitmap, Point.Empty);
ev.HasMorePages = false;
};
printDocument.EndPrint += (sender, args) =>
{
var buyerDTO = buyerRow.Buyer;
buyerDTO.EnvelopePrinted = true;
View.Control.Invoke(new Action(() => View.UpdateBuyer(buyerDTO)));
Manager.UpdateBuyer(buyerDTO);
((IDisposable)sender).Dispose();
View.Control.Invoke(
new Action(() => View.SetResetPrintStatusEnable(View.CurrentBuyers.Any(buyer => buyer.EnvelopePrinted))));
};
printDocument.Print();
据我了解,EndPrint事件发生在文档呈现(并发送到打印机)但尚未打印在纸上时。
我应该检查文件是否实际打印在纸上。我怎样才能做到这一点?