Reputation: 7092
i`m working with PrintDocument class using the following code:
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();
as i understand EndPrint event occurs when document rendered (and sent to printer), but not yet printed on paper.
I should check is document actually printed on paper. How can i do this?
Upvotes: 3
Views: 2388
Reputation: 37790
I should check is document actually printed on paper
In general case, you can't achieve what you want with abstract printer.
Even if you'll monitor printing job state for particular printer, using spooler API, you can run into the case, when job was sent to printer (thus, spooler thinks, that it was printed), but there were no actual printing (e.g., paper has ended, and the user has rebooted printer).
Upvotes: 1