[]
Represents a running instance of a headless Chromium-based browser.
public class GcHtmlBrowser : IDisposable
Initializes a new instance of the GcHtmlBrowser class.
public GcHtmlBrowser(string executablePath, LaunchOptions launchOptions = null)
executablePath
stringPath to a Chrome, Edge, or Chromium executable to run.
launchOptions
LaunchOptionsOptions for launching the browser.
Gets the current platform for launching the browser.
public static Platform CurrentPlatform { get; }
Gets the browser error log as a string.
public string ErrorLog { get; }
Gets a value indicating whether the browser engine is connected.
public bool IsConnected { get; }
Gets or sets the last message in the browser log.
public static string LastLogMessage { get; set; }
Gets the timeout settings for various browser operations.
public TimeoutOptions TimeoutOptions { get; }
Applies a GcImaging license key to use by the current instance of GcHtmlBrowser.
Up to five images can be created without a license.
public void ApplyGcImagingLicenseKey(string key)
key
stringThe GcImaging license key to apply.
Applies a GcPdf license key to use by the current instance of GcHtmlBrowser.
Up to five PDFs can be created without a license.
public void ApplyGcPdfLicenseKey(string key)
key
stringThe GcPdf license key to apply.
Clears all messages in the error log.
public void ClearErrorLog()
Clean up any resources being used.
public void Dispose()
Performs cleanup operations on unmanaged resources.
protected ~GcHtmlBrowser()
Creates a new page and assigns an HTML markup to the page.
public HtmlPage NewPage(string html, PageOptions pageOptions = null)
html
stringThe HTML markup to set.
pageOptions
PageOptionsConfiguration options for the new page.
Creates a new page and navigates to a specified Uri.
public HtmlPage NewPage(Uri uri, PageOptions pageOptions = null)
uri
System.UriThe target Uri.
pageOptions
PageOptionsConfiguration options for the new page.
Sets a GcImaging license key to use by all instances of GcHtmlBrowser.
Up to five images can be created without a license.
public static void SetGcImagingLicenseKey(string key)
key
stringThe GcImaging license key to set.
Sets a GcPdf license key to use by all instances of GcHtmlBrowser.
Up to five PDFs can be created without a license.
public static void SetGcPdfLicenseKey(string key)
key
stringThe GcPdf license key to set.