Table of Contents

Class WaitOptions

Namespace
CobaltPdf.Configuration
Assembly
CobaltPdf.dll

Base class for defining a wait strategy before PDF rendering.

public abstract class WaitOptions
Inheritance
WaitOptions
Inherited Members

Properties

DefaultNetworkIdle

The default. Waits for the network to be idle (no requests for 500ms).

public static WaitOptions DefaultNetworkIdle { get; }

Property Value

WaitOptions

Methods

ForDelay(TimeSpan)

Waits for a fixed time delay.

public static WaitOptions ForDelay(TimeSpan delay)

Parameters

delay TimeSpan

Returns

WaitOptions

ForJavaScript(string, TimeSpan?)

Waits for a JavaScript expression to become 'true'. The script is polled until it returns a truthy value.

public static WaitOptions ForJavaScript(string jsExpression, TimeSpan? timeout = null)

Parameters

jsExpression string

The JS expression (e.g., "window.myApp.isDataLoaded === true").

timeout TimeSpan?

An optional override for the wait timeout.

Returns

WaitOptions

ForSelector(string, TimeSpan?)

Waits for a specific CSS selector to be visible on the page.

public static WaitOptions ForSelector(string selector, TimeSpan? timeout = null)

Parameters

selector string

The CSS selector (e.g., "#my-id", ".my-class").

timeout TimeSpan?

An optional override for the wait timeout.

Returns

WaitOptions

ForSignal(TimeSpan)

Waits for a 'window.cobaltNotifyRender()' signal from JavaScript. This is the most robust way to handle complex, asynchronous scripts.

public static WaitOptions ForSignal(TimeSpan timeout)

Parameters

timeout TimeSpan

The maximum time to wait for the signal.

Returns

WaitOptions