[]
        
(Showing Draft Content)

GrapeCity.Documents.Html.GcHtmlBrowser

Class GcHtmlBrowser

Namespace
GrapeCity.Documents.Html
Assembly
GcDocs.Html.dll

Represents a running instance of a headless Chromium-based browser.

public class GcHtmlBrowser : IDisposable
Inheritance
object
GcHtmlBrowser
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

GcHtmlBrowser(string, LaunchOptions)

Initializes a new instance of the GcHtmlBrowser class.

public GcHtmlBrowser(string executablePath, LaunchOptions launchOptions = null)

Parameters

executablePath string

Path to a Chrome, Edge, or Chromium executable to run.

launchOptions LaunchOptions

Options for launching the browser.

Properties

CurrentPlatform

Gets the current platform for launching the browser.

public static Platform CurrentPlatform { get; }

Property Value

Platform

ErrorLog

Gets the browser error log as a string.

public string ErrorLog { get; }

Property Value

string

IsConnected

Gets a value indicating whether the browser engine is connected.

public bool IsConnected { get; }

Property Value

bool

LastLogMessage

Gets or sets the last message in the browser log.

public static string LastLogMessage { get; set; }

Property Value

string

TimeoutOptions

Gets the timeout settings for various browser operations.

public TimeoutOptions TimeoutOptions { get; }

Property Value

TimeoutOptions

Methods

ApplyGcImagingLicenseKey(string)

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)

Parameters

key string

The GcImaging license key to apply.

See Also

ApplyGcPdfLicenseKey(string)

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)

Parameters

key string

The GcPdf license key to apply.

See Also

ClearErrorLog()

Clears all messages in the error log.

public void ClearErrorLog()

Dispose()

Clean up any resources being used.

public void Dispose()

~GcHtmlBrowser()

Performs cleanup operations on unmanaged resources.

protected ~GcHtmlBrowser()

NewPage(string, PageOptions)

Creates a new page and assigns an HTML markup to the page.

public HtmlPage NewPage(string html, PageOptions pageOptions = null)

Parameters

html string

The HTML markup to set.

pageOptions PageOptions

Configuration options for the new page.

Returns

HtmlPage

The created HtmlPage.

NewPage(Uri, PageOptions)

Creates a new page and navigates to a specified Uri.

public HtmlPage NewPage(Uri uri, PageOptions pageOptions = null)

Parameters

uri System.Uri

The target Uri.

pageOptions PageOptions

Configuration options for the new page.

Returns

HtmlPage

The created HtmlPage if navigation was successful, null otherwise.

SetGcImagingLicenseKey(string)

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)

Parameters

key string

The GcImaging license key to set.

See Also

SetGcPdfLicenseKey(string)

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)

Parameters

key string

The GcPdf license key to set.

See Also