When we open an internet explorer(IE6 or IE7) and select File->Print
a print dialog is obtained, how can we catch these, and how can we catch the data that is going to printer, If there are 5 printers installed then how can we know the Printer name which is selected for printing(not the default printer's name),
how can get the BeginPrint, EndPrint, PrintPage Events fired?
Loading
JasonPosted Jul 16, 2009, 8:52 AM
MSDN has a good example of this.
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.print.aspx
PrintDocument printDoc = new PrintDocument()
printDoc.BeginPrint += new PrintEventHandler(some_method);
printDoc.PrintPage += new PrintPageEventHandler(some_otherMethod);
printDoc.EndPrint += new PrintEventHandler(some_thirdMethod);
public void some_method(object sender, PrintEventArgs e)
{
//do some work
}
public void some_otherMethod(object sender, PrintPageEventArgs e)
{
//to print work
}