|
This property determines whether JavaScript and VBScript are
enabled.
By default client-side script such as JavaScript is enabled when
rendering HTML documents. You may wish to change this default
setting for performance or security reasons.
The ABCChrome engine relies on JavaScript for HTML analysis. If
you disable it the HtmlOptions.Media,
HtmlOptions.AddForms, HtmlOptions.AddTags and HtmlOptions.OnLoadScript will cease to
operate. In addition the HtmlOptions.BrowserWidth zero setting, which
allows the page autosize behavior, will default to the HtmlOptions.InitialWidth setting.
If you have a server edition of Windows (e.g. Windows Server
2008) and are using the MSHTML engine, you may need to also disable
Enhanced Security Configuration for user running the
program/application pool to allow JavaScript execution.
|
Script-Accessible Functions and Properties. These are
functions and properties that script inside HTML can access. The
function signatures shown are in C#-like syntax. You'll need to
pass in the correct number of arguments.
bool ABCpdf_RenderWait();
Private Function ABCpdf_RenderWait() As Boolean
| MSHTML
only
|
|
window.external.ABCpdf_RenderWait – Delays ABCpdf's
rendering of the HTML page. |
| |
| |
| Name
|
Description
|
| return |
True if ABCpdf waits (i.e. the function succeeds), otherwise
false. |
|
| |
When this function is called before the page load
is considered complete, the page load is not considered complete
until ABCpdf_RenderComplete is called. This function returns false
if ABCpdf_RenderComplete has been called. This is useful if the
page relies on timeout/asynchronous events (AJAX). |
bool ABCpdf_RenderComplete();
bool ABCpdf_RenderComplete(bool force);
Private Function ABCpdf_RenderComplete() As Boolean
Private Function ABCpdf_RenderComplete(ByVal force As Boolean) As Boolean
| MSHTML
only
|
|
window.external.ABCpdf_RenderComplete – Resumes ABCpdf's
rendering of the HTML page. |
| |
| |
| Name
|
Description
|
| force |
Whether ABCpdf ignores normal indications of page load
completion. The default value is false. |
| return |
True if ABCpdf resumes rendering as requested (i.e. the
function succeeds), otherwise false. |
|
| |
This function can be called whether
ABCpdf_RenderWait has/has not been called. If force is false,
ABCpdf resumes normal rendering. If force is true, ABCpdf starts
rendering immediately, ignoring all other indications of page load
completion. This function returns false if force is false and the
function has been previously called with force true. This is useful
if the page relies on timeout/asynchronous events (AJAX). |
| |
Doc doc = new Doc();
doc.HtmlOptions.Engine = EngineType.MSHtml;
doc.HtmlOptions.UseScript = true;
// Render after 3 seconds
doc.HtmlOptions.OnLoadScript = "(function(){"
+ " window.external.ABCpdf_RenderWait();"
+ " setTimeout(function(){ window.external.ABCpdf_RenderComplete(); }, 3000);"
+ "})();";
doc.AddImageUrl("http://www.websupergoo.com");
doc.Save(Server.MapPath("wsg.pdf"));
Dim theDoc As Doc = New Doc()
theDoc.HtmlOptions.Engine = EngineType.MSHtml
theDoc.HtmlOptions.UseScript = True
' Render after 3 seconds
theDoc.HtmlOptions.OnLoadScript = "(function(){" _
& " window.external.ABCpdf_RenderWait();" _
& " setTimeout(function(){ window.external.ABCpdf_RenderComplete(); }, 3000);" _
& "})();"
theDoc.AddImageUrl("http://www.websupergoo.com")
theDoc.Save(Server.MapPath("wsg.pdf"))
|
bool ABCpdf_go;
Dim ABCpdf_go As Boolean
| Gecko
only
|
|
window.ABCpdf_go – Specifies whether ABCpdf proceeds to
render the HTML page. |
| |
| |
| Value
|
Description
|
| undefined (initial value), true |
ABCpdf proceeds to render the HTML page. |
| false |
ABCpdf waits. |
|
| |
UseScript has to be true and OnLoadScript has to be non-empty for this
property to be effectual. ABCpdf will wait for this property to be
either undefined or true before rendering the HTML page. The whole
HTML rendering operation is still subject to the Timeout property's value. Usually, this property
is set to false in OnLoadScript and is also set to true in an event
listener added in OnLoadScript. If assignments to this property are
provided in both OnLoadScript and the script in the web page,
please refer to the notes in OnLoadScript for the order of
execution. |
| |
Doc doc = new Doc();
doc.HtmlOptions.Engine = EngineType.Gecko;
doc.HtmlOptions.UseScript = true;
// Render after 3 seconds
doc.HtmlOptions.OnLoadScript = "(function(){"
+ " window.ABCpdf_go = false;"
+ " setTimeout(function(){ window.ABCpdf_go = true; }, 3000);"
+ "})();";
doc.AddImageUrl("http://www.websupergoo.com");
doc.Save(Server.MapPath("wsg.pdf"));
Dim theDoc As Doc = New Doc()
theDoc.HtmlOptions.Engine = EngineType.Gecko
theDoc.HtmlOptions.UseScript = True
' Render after 3 seconds
theDoc.HtmlOptions.OnLoadScript = "(function(){" _
& " window.ABCpdf_go = false;" _
& " setTimeout(function(){ window.ABCpdf_go = true; }, 3000);" _
& "})();"
theDoc.AddImageUrl("http://www.websupergoo.com")
theDoc.Save(Server.MapPath("wsg.pdf"))
|
| ABCChrome
only
|
|
ABCChromeExt.Render() – Triggers immediate conversion of
the HTML page. |
| |
void ABCChromeExt.Render();
Private Sub Render()
|
| |
| Value
|
Description
|
| n/a |
n/a |
|
| |
Calling the method ABCChromeExt.Render() in any JavaScript
executed within an HTML page will force the immediate rendering of
the page to PDF without delay.
This option cannot be used in HtmlOptions.OnLoadScript - no
error will occur but processing will not be curtailed.
You will need to set a sensible value for
HtmlOptions.RenderDelay to allow processing to continue past the
OnLoad event.
|
|
|
|
|