public class WaitFor extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DefaultMaxWaitTime
Default maximum wait time in milliseconds
|
static int |
DefaultRenderDelayDuration
Default render delay duration in milliseconds.
|
| Constructor and Description |
|---|
WaitFor()
Default construct WaitFor object.
|
WaitFor(int maxWaitTime)
Default construct WaitFor object.
|
WaitFor(int maxWaitTime,
int renderDelay)
Default construct WaitFor object.
|
WaitFor(WaitForType type,
int maxWaitTime,
int networkIdleDuration,
int numAllowedInflight,
int renderDelayDuration,
String htmlElementQueryStr)
Intended to be used internally as our API recommends user to use convenient methods e.g.
|
| Modifier and Type | Method and Description |
|---|---|
void |
AllFontsLoaded()
This method proceeds rendering by waiting until all of its fonts have been loaded.
|
void |
AllFontsLoaded(int maxWaitTime)
This method proceeds rendering by waiting until all of its fonts have been loaded.
|
String |
getHtmlElementQueryStr() |
int |
getNetworkIdleDuration() |
int |
getNumAllowedInFlight() |
int |
getRenderDelayDuration() |
int |
getTimeout() |
WaitForType |
getType() |
void |
HtmlElementByClassName(String classAttribName)
This method proceeds rendering by waiting until it finds the HTML element whose the class name as of the specified one.
|
void |
HtmlElementByClassName(String classAttribName,
int maxWaitTime)
This method proceeds rendering by waiting until it finds the HTML element whose the class name as of the specified one.
|
void |
HtmlElementById(String id)
This method proceeds rendering by waiting until it finds the HTML element that has the same id as specified one.
|
void |
HtmlElementById(String id,
int maxWaitTime)
This method proceeds rendering by waiting until it finds the HTML element that has the same id as specified one.
|
void |
HtmlElementByName(String name)
This method proceeds rendering by waiting until it finds the element with the attribute name as of the specified one.
|
void |
HtmlElementByName(String name,
int maxWaitTime)
This method proceeds rendering by waiting until it finds the element with the attribute name as of the specified one.
|
void |
HtmlElementByTagName(String tagName)
This method proceeds rendering by waiting until it finds the HTML element that itself has the same tag name as of specified one.
|
void |
HtmlElementByTagName(String tagName,
int maxWaitTime)
This method proceeds rendering by waiting until it finds the HTML element that itself has the same tag name as of specified one.
|
void |
HtmlQuerySelector(String htmlQueryStr)
This method proceeds rendering by waiting until it finds the HTML element via the specified query string which is executed by a JavaScript function
document.querySelector(). |
void |
HtmlQuerySelector(String htmlQueryStr,
int maxWaitTime)
This method proceeds rendering by waiting until it finds the HTML element via the specified query string which is executed by a JavaScript function
document.querySelector(). |
void |
JavaScript()
This method proceeds rendering by waiting until user calls IronPdf's internal JavaScript function
window.ironpdf.notifyRender(). |
void |
JavaScript(int maxWaitTime)
This method proceeds rendering by waiting until user calls IronPdf's internal JavaScript function
window.ironpdf.notifyRender(). |
void |
NetworkIdle(int networkIdleDuration,
int maxNumAllowedInflight)
This method proceeds rendering by waiting until it internally detects a network idle event when there is no network activity
after at least specified networkIdleDuration as well as at maximum of maxNumAllowedInflight inflight (outstanding) network requests.
|
void |
NetworkIdle(int networkIdleDuration,
int maxNumAllowedInflight,
int maxWaitTime)
This method proceeds rendering by waiting until it internally detects a network idle event when there is no network activity
after at least specified networkIdleDuration as well as at maximum of maxNumAllowedInflight inflight (outstanding) network requests.
|
void |
NetworkIdle0()
This method proceeds rendering by waiting until it internally detects a network idle event when there is no network activity.
|
void |
NetworkIdle0(int maxWaitTime)
This method proceeds rendering by waiting until it internally detects a network idle event when there is no network activity.
|
void |
NetworkIdle2()
This method proceeds rendering by waiting until it internally detects a network idle event when there is no network activity
after at least 500ms as well as at maximum of 2 inflight (outstanding) network request.
|
void |
NetworkIdle2(int maxWaitTime)
This method proceeds rendering by waiting until it internally detects a network idle event when there is no network activity
after at least 500ms as well as at maximum of 2 inflight (outstanding) network request.
|
void |
PageLoad()
Basically it waits for nothing, but will render as soon as the page loaded.
|
void |
RenderDelay(int delay)
This method proceeds rendering by introducing an initial delay before rendering.
|
public static final int DefaultMaxWaitTime
public static final int DefaultRenderDelayDuration
public WaitFor(int maxWaitTime)
maxWaitTime - Maximum wait time in milliseconds until it forces rendering. Default value is DefaultMaxWaitTimepublic WaitFor()
public WaitFor(int maxWaitTime,
int renderDelay)
maxWaitTime - Maximum wait time in milliseconds until it forces rendering. Default value is DefaultMaxWaitTimerenderDelay - Render delay in milliseconds. It will delay before rendering. Default value is DefaultRenderDelayDuration
This will set to RenderDelay(int).public WaitFor(WaitForType type, int maxWaitTime, int networkIdleDuration, int numAllowedInflight, int renderDelayDuration, String htmlElementQueryStr)
JavaScript(int),
NetworkIdle0(int) and others to construct the WaitFor object instead of manually setting each data fields.
We use this internally as part of parsing ProtoBuf structure.type - WaitFor typemaxWaitTime - Maximum wait time in milliseconds until it forces rendering.networkIdleDuration - Network idle duration to be regarded as network idle event.numAllowedInflight - Number of inflight network request allowed to have while still regarded it as network idle event.renderDelayDuration - Amount of time to delay before rendering (in ms)htmlElementQueryStr - HTML element query string that will be passed to JavaScript's document#querySelector().public final WaitForType getType()
public final int getTimeout()
public final int getNetworkIdleDuration()
public final int getNumAllowedInFlight()
public final int getRenderDelayDuration()
public final String getHtmlElementQueryStr()
public final void PageLoad()
There is no need to call this method if user desires to normally render the page. It is mostly useful to reset WaitFor configurations back to wait for nothing.
Page loaded in this case means only loaded in DOM, not the resource loaded.public final void RenderDelay(int delay)
delay - Delay time in milliseconds before renderingpublic final void JavaScript()
window.ironpdf.notifyRender().public final void JavaScript(int maxWaitTime)
window.ironpdf.notifyRender().maxWaitTime - Maximum wait time in milliseconds until it forces rendering. Default value is DefaultMaxWaitTimepublic final void NetworkIdle0()
public final void NetworkIdle0(int maxWaitTime)
maxWaitTime - Maximum wait time in milliseconds until it forces rendering. Default value is DefaultMaxWaitTimepublic final void NetworkIdle2()
public final void NetworkIdle2(int maxWaitTime)
maxWaitTime - Maximum wait time in milliseconds until it forces rendering. Default value is DefaultMaxWaitTimepublic final void NetworkIdle(int networkIdleDuration,
int maxNumAllowedInflight)
networkIdleDuration - Duration of time in milliseconds to regard as network idle eventmaxNumAllowedInflight - Maximum number of allowed inflight network requests to not invalidate network idle eventpublic final void NetworkIdle(int networkIdleDuration,
int maxNumAllowedInflight,
int maxWaitTime)
networkIdleDuration - Duration of time in milliseconds to regard as network idle eventmaxNumAllowedInflight - Maximum number of allowed inflight network requests to not invalidate network idle eventmaxWaitTime - Maximum wait time in milliseconds until it forces rendering. Default value is DefaultMaxWaitTimepublic final void HtmlQuerySelector(String htmlQueryStr)
document.querySelector().
htmlQueryStr - HTML element query string to query for with Javascript's document#querySelector()public final void HtmlQuerySelector(String htmlQueryStr, int maxWaitTime)
document.querySelector().
htmlQueryStr - HTML element query string to query for with Javascript's document#querySelector()maxWaitTime - Maximum wait time (in ms) until it forces rendering. Default is DefaultMaxWaitTime.public final void HtmlElementById(String id)
Related JavaScript API that works similarly to this method is getElementsByClassName()
but instead it makes a query directly via `document.querySelector()` as it calls HtmlQuerySelector(String, int) internally.
id - Target element Id. Id token must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").IronPdfInputException - Thrown if input id is invalid not according to HTML name and Id naming rule.public final void HtmlElementById(String id, int maxWaitTime)
Related JavaScript API that works similarly to this method is getElementsByClassName()
but instead it makes a query directly via `document.querySelector()` as it calls HtmlQuerySelector(String, int) internally.
id - Target element Id. Id token must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").maxWaitTime - Maximum wait time (in ms) until it forces rendering. Default is DefaultMaxWaitTime.IronPdfInputException - Thrown if input id is invalid not according to HTML name and Id naming rule.public final void HtmlElementByName(String name)
Related JavaScript API that works similarly to this method is getElementsByName()
but effective only for first found element from the result. Instead it makes a query directly via `document.querySelector()` as it calls HtmlQuerySelector(String, int) internally.
name - Target element name# Name token must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").IronPdfInputException - Thrown if input name is invalid not according to HTML name and Id naming rule.public final void HtmlElementByName(String name, int maxWaitTime)
Related JavaScript API that works similarly to this method is getElementsByName()
but effective only for first found element from the result. Instead it makes a query directly via `document.querySelector()` as it calls HtmlQuerySelector(String, int) internally.
name - Target element name# Name token must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").maxWaitTime - Maximum wait time (in ms) until it forces rendering. Default is DefaultMaxWaitTime.IronPdfInputException - Thrown if input name is invalid not according to HTML name and Id naming rule.public final void HtmlElementByTagName(String tagName)
Related JavaScript API that works similarly to this method is getElementsByTagName()
but effective only for first found element from the result. Instead it makes a query directly via document.querySelector() as it calls HtmlQuerySelector(String, int) internally.
tagName - Target element's tag name# Tag name token must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").IronPdfInputException - Thrown if input name is invalid not according to HTML name and Id naming rule.public final void HtmlElementByTagName(String tagName, int maxWaitTime)
Related JavaScript API that works similarly to this method is getElementsByTagName()
but effective only for first found element from the result. Instead it makes a query directly via document.querySelector() as it calls HtmlQuerySelector(String, int) internally.
tagName - Target element's tag name# Tag name token must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").maxWaitTime - Maximum wait time (in ms) until it forces rendering. Default is DefaultMaxWaitTime.IronPdfInputException - Thrown if input name is invalid not according to HTML name and Id naming rule.public final void HtmlElementByClassName(String classAttribName)
Related JavaScript API that works similarly to this method is getElementsByClassName()
but effective only for first found element from the result. Instead it makes a query directly via document.querySelector() as it calls HtmlQuerySelector(String, int) )} internally.
classAttribName - Target element's class attribute name# Class attribute name token must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), and underscores ("_").IronPdfInputException - Thrown if input name is invalid not according to HTML name and Id naming rule.public final void HtmlElementByClassName(String classAttribName, int maxWaitTime)
Related JavaScript API that works similarly to this method is getElementsByClassName()
but effective only for first found element from the result. Instead it makes a query directly via document.querySelector() as it calls HtmlQuerySelector(String, int) )} internally.
classAttribName - Target element's class attribute name# Class attribute name token must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), and underscores ("_").maxWaitTime - Maximum wait time (in ms) until it forces rendering. Default is DefaultMaxWaitTime.IronPdfInputException - Thrown if input name is invalid not according to HTML name and Id naming rule.public final void AllFontsLoaded()
public final void AllFontsLoaded(int maxWaitTime)
maxWaitTime - maximum wait time (in ms) until it forces rendering. Default is DefaultMaxWaitTime.Copyright © 2022–2025 Iron Software. All rights reserved.