Table of Contents

Property RequestPrintHandler

Namespace
DotNetBrowser.Browser
Assembly
DotNetBrowser.dll

RequestPrintHandler

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

IHandler<RequestPrintParameters, RequestPrintResponse> RequestPrintHandler { get; set; }

Property Value

IHandler<RequestPrintParameters, RequestPrintResponse>

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.

Exceptions

ObjectDisposedException

The IBrowser has already been disposed.