Class WaitFor
- java.lang.Object
- 
- com.ironsoftware.ironpdf.render.WaitFor
 
- 
 public class WaitFor extends Object 
- 
- 
Field SummaryFields Modifier and Type Field Description static intDefaultMaxWaitTimeDefault maximum wait time in millisecondsstatic intDefaultRenderDelayDurationDefault render delay duration in milliseconds.
 - 
Constructor SummaryConstructors Constructor 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.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidAllFontsLoaded()This method proceeds rendering by waiting until all of its fonts have been loaded.voidAllFontsLoaded(int maxWaitTime)This method proceeds rendering by waiting until all of its fonts have been loaded.StringgetHtmlElementQueryStr()intgetNetworkIdleDuration()intgetNumAllowedInFlight()intgetRenderDelayDuration()intgetTimeout()WaitForTypegetType()voidHtmlElementByClassName(String classAttribName)This method proceeds rendering by waiting until it finds the HTML element whose the class name as of the specified one.voidHtmlElementByClassName(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.voidHtmlElementById(String id)This method proceeds rendering by waiting until it finds the HTML element that has the same id as specified one.voidHtmlElementById(String id, int maxWaitTime)This method proceeds rendering by waiting until it finds the HTML element that has the same id as specified one.voidHtmlElementByName(String name)This method proceeds rendering by waiting until it finds the element with the attribute name as of the specified one.voidHtmlElementByName(String name, int maxWaitTime)This method proceeds rendering by waiting until it finds the element with the attribute name as of the specified one.voidHtmlElementByTagName(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.voidHtmlElementByTagName(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.voidHtmlQuerySelector(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 functiondocument.querySelector().voidHtmlQuerySelector(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 functiondocument.querySelector().voidJavaScript()This method proceeds rendering by waiting until user calls IronPdf's internal JavaScript functionwindow.ironpdf.notifyRender().voidJavaScript(int maxWaitTime)This method proceeds rendering by waiting until user calls IronPdf's internal JavaScript functionwindow.ironpdf.notifyRender().voidNetworkIdle(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.voidNetworkIdle(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.voidNetworkIdle0()This method proceeds rendering by waiting until it internally detects a network idle event when there is no network activity.voidNetworkIdle0(int maxWaitTime)This method proceeds rendering by waiting until it internally detects a network idle event when there is no network activity.voidNetworkIdle2()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.voidNetworkIdle2(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.voidPageLoad()Basically it waits for nothing, but will render as soon as the page loaded.voidRenderDelay(int delay)This method proceeds rendering by introducing an initial delay before rendering.
 
- 
- 
- 
Field Detail- 
DefaultMaxWaitTimepublic static final int DefaultMaxWaitTime Default maximum wait time in milliseconds- See Also:
- Constant Field Values
 
 - 
DefaultRenderDelayDurationpublic static final int DefaultRenderDelayDuration Default render delay duration in milliseconds.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
WaitForpublic WaitFor(int maxWaitTime) Default construct WaitFor object. Convenient method to construct a WaitFor object with default values.- Parameters:
- maxWaitTime- Maximum wait time in milliseconds until it forces rendering. Default value is- DefaultMaxWaitTime
 
 - 
WaitForpublic WaitFor() Default construct WaitFor object. Convenient method to construct a WaitFor object with default values.
 - 
WaitForpublic WaitFor(int maxWaitTime, int renderDelay)Default construct WaitFor object. Convenient method to construct a WaitFor object with default values.- Parameters:
- maxWaitTime- Maximum wait time in milliseconds until it forces rendering. Default value is- DefaultMaxWaitTime
- renderDelay- Render delay in milliseconds. It will delay before rendering. Default value is- DefaultRenderDelayDurationThis will set to- RenderDelay(int).
 
 - 
WaitForpublic 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.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.- Parameters:
- type- WaitFor type
- maxWaitTime- 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().
 
 
- 
 - 
Method Detail- 
getTypepublic final WaitForType getType() 
 - 
getTimeoutpublic final int getTimeout() 
 - 
getNetworkIdleDurationpublic final int getNetworkIdleDuration() 
 - 
getNumAllowedInFlightpublic final int getNumAllowedInFlight() 
 - 
getRenderDelayDurationpublic final int getRenderDelayDuration() 
 - 
getHtmlElementQueryStrpublic final String getHtmlElementQueryStr() 
 - 
PageLoadpublic final void PageLoad() Basically it waits for nothing, but will render as soon as the page loaded.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.
 - 
RenderDelaypublic final void RenderDelay(int delay) This method proceeds rendering by introducing an initial delay before rendering.- Parameters:
- delay- Delay time in milliseconds before rendering
 
 - 
JavaScriptpublic final void JavaScript() This method proceeds rendering by waiting until user calls IronPdf's internal JavaScript functionwindow.ironpdf.notifyRender().
 - 
JavaScriptpublic final void JavaScript(int maxWaitTime) This method proceeds rendering by waiting until user calls IronPdf's internal JavaScript functionwindow.ironpdf.notifyRender().- Parameters:
- maxWaitTime- Maximum wait time in milliseconds until it forces rendering. Default value is- DefaultMaxWaitTime
 
 - 
NetworkIdle0public final void NetworkIdle0() 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 no inflight (outstanding) network requests.
 - 
NetworkIdle0public final void NetworkIdle0(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 no inflight (outstanding) network requests.- Parameters:
- maxWaitTime- Maximum wait time in milliseconds until it forces rendering. Default value is- DefaultMaxWaitTime
 
 - 
NetworkIdle2public final 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.
 - 
NetworkIdle2public final 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.- Parameters:
- maxWaitTime- Maximum wait time in milliseconds until it forces rendering. Default value is- DefaultMaxWaitTime
 
 - 
NetworkIdlepublic final 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.- Parameters:
- networkIdleDuration- Duration of time in milliseconds to regard as network idle event
- maxNumAllowedInflight- Maximum number of allowed inflight network requests to not invalidate network idle event
 
 - 
NetworkIdlepublic final 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.- Parameters:
- networkIdleDuration- Duration of time in milliseconds to regard as network idle event
- maxNumAllowedInflight- Maximum number of allowed inflight network requests to not invalidate network idle event
- maxWaitTime- Maximum wait time in milliseconds until it forces rendering. Default value is- DefaultMaxWaitTime
 
 - 
HtmlQuerySelectorpublic final 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 functiondocument.querySelector().- Parameters:
- htmlQueryStr- HTML element query string to query for with Javascript's document#querySelector()
 
 - 
HtmlQuerySelectorpublic final 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 functiondocument.querySelector().- Parameters:
- 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.
 
 - 
HtmlElementByIdpublic final void HtmlElementById(String id) This method proceeds rendering by waiting until it finds the HTML element that has the same id as specified one.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.- Parameters:
- 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 (".").
- Throws:
- IronPdfInputException- Thrown if input id is invalid not according to HTML name and Id naming rule.
 
 - 
HtmlElementByIdpublic final 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.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.- Parameters:
- 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.
- Throws:
- IronPdfInputException- Thrown if input id is invalid not according to HTML name and Id naming rule.
 
 - 
HtmlElementByNamepublic final void HtmlElementByName(String name) This method proceeds rendering by waiting until it finds the element with the attribute name as of the specified one.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.- Parameters:
- 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 (".").
- Throws:
- IronPdfInputException- Thrown if input name is invalid not according to HTML name and Id naming rule.
 
 - 
HtmlElementByNamepublic final 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.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.- Parameters:
- 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.
- Throws:
- IronPdfInputException- Thrown if input name is invalid not according to HTML name and Id naming rule.
 
 - 
HtmlElementByTagNamepublic final 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.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 callsHtmlQuerySelector(String, int)internally.- Parameters:
- 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 (".").
- Throws:
- IronPdfInputException- Thrown if input name is invalid not according to HTML name and Id naming rule.
 
 - 
HtmlElementByTagNamepublic final 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.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 callsHtmlQuerySelector(String, int)internally.- Parameters:
- 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.
- Throws:
- IronPdfInputException- Thrown if input name is invalid not according to HTML name and Id naming rule.
 
 - 
HtmlElementByClassNamepublic final 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.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 callsHtmlQuerySelector(String, int))} internally.- Parameters:
- 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 ("_").
- Throws:
- IronPdfInputException- Thrown if input name is invalid not according to HTML name and Id naming rule.
 
 - 
HtmlElementByClassNamepublic final 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.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 callsHtmlQuerySelector(String, int))} internally.- Parameters:
- 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.
- Throws:
- IronPdfInputException- Thrown if input name is invalid not according to HTML name and Id naming rule.
 
 - 
AllFontsLoadedpublic final void AllFontsLoaded() This method proceeds rendering by waiting until all of its fonts have been loaded. Such font types can local, remote, or google web fonts.
 - 
AllFontsLoadedpublic final void AllFontsLoaded(int maxWaitTime) This method proceeds rendering by waiting until all of its fonts have been loaded. Such font types can local, remote, or google web fonts.- Parameters:
- maxWaitTime- maximum wait time (in ms) until it forces rendering. Default is- DefaultMaxWaitTime.
 
 
- 
 
-