Property PrintHtmlContentHandler
- Namespace
- DotNetBrowser.Browser
- Assembly
- DotNetBrowser.dll
PrintHtmlContentHandler
Gets or sets a handler that is used when the HTML content printing is initiated.
IHandler<PrintHtmlContentParameters, PrintHtmlContentResponse> PrintHtmlContentHandler { get; set; }
Property Value
Remarks
In this callback you can configure the print settings. The workflow is the following:
-
Find the required printer using the IPrinters<TPrintSettings, TPdfPrintSettings> interface. You can obtain an instance of Printers
using the Printers property. -
Get the current IPrintJob<TPrintSettings> from the printer. -
Configure the required settings for the print job using the IPrintSettings interface provided by the Settings property. -
Apply the configured settings using the Apply() method. -
Tell the browser to proceed with the printing using the configured settings: Print(SystemPrinter<IHtmlSettings>).
Use the Print(SystemPrinter<IHtmlSettings>) method to continue printing using the selected printer.
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.
If printing is initiated when the browser is loading a web page, this callback is not invoked.
Exceptions
- ObjectDisposedException
The IBrowser has already been disposed.