Note: Advice in this article will only work for DotNetBrowser 1.
See the corresponding article for DotNetBrowser 2 here.

The web page you load in browser can be printed using one of the following ways:

  • Using the window.print() JavaScript function. This function can be invoked from JavaScript code on the loaded web page (e.g. when user clicks some button, JavaScript code invokes this function to print the web page). 
  • Using the Browser.Print() method of DotNetBrowser API. For example, you can invoke this method when user presses Print button in your .NET application. For example:


printButton.Click += delegate(object sender, RoutedEventArgs e)


AddHandler printButton.Click, Sub(sender As Object, e As RoutedEventArgs) browser.Print()

Both methods prints currently loaded web page using default print settings. If you need to print web page with custom print settings, you must register your own implementation of PrintHandler interface where you can override default print settings or cancel printing.