Click or drag to resize

IBrowserRequestPrintHandler Property

Gets or sets a handler that is used when the printing is initiated.

Namespace:  DotNetBrowser.Browser
Assembly:  DotNetBrowser (in DotNetBrowser.dll) Version: 2.23.1
Syntax
C#
IHandler<RequestPrintParameters, RequestPrintResponse> RequestPrintHandler { get; set; }

Property Value

Type: IHandlerRequestPrintParameters, RequestPrintResponse
Exceptions
ExceptionCondition
ObjectDisposedExceptionThe IBrowser has already been disposed.
Remarks

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.

See Also