IBrowserRequestPrintHandler Property |
Namespace: DotNetBrowser.Browser
IHandler<RequestPrintParameters, RequestPrintResponse> RequestPrintHandler { get; set; }
Exception | Condition |
---|---|
ObjectDisposedException | The IBrowser has already been disposed. |
In this callback you can cancel or allow showing print preview dialog, or print the content programmatically.
By default, the printing is canceled if there is no browser view initialized from the browser.
Use the ShowPrintPreview method to show the print preview.
Use the Print method to continue printing and configure it programmatically in PrintHtmlContentHandler and PrintPdfContentHandler.
Use the Cancel method to cancel printing.
If an exception occurs inside the handler implementation, the default behavior will be applied - the method Cancel will be used.
Important: do not use ShowPrintPreview if the browser is not displayed. In this case, the dialog will not be visible - as a result, the end user will not be able to close it or confirm printing.