Description (requires ScriptX v7 or later)

This method is an enhanced version of PrintHTML.

Prints either specified HTML text or the HTML document specified by the URL using the current printing settings in the same session context. The method is asynchronous. It returns before the document is downloaded and printed. Notifications are sent to the supplied callback function to give details on progress of processing.

Important note: The HTML to be printed must not be ‘ScriptX-enabled’ - it must not contain an object tag referencing the ScriptX object nor script code that uses that object. Attempting to print HTML (either specified HTML text or a document specified by url) that contains the ScriptX object can lead to strange errors and failure of the entire printing process, including causing Internet Explorer to stop responding.

PrintHTMLEx should not be used with OwnQueue.


printing.PrintHTML(url, prompt, callback, callbackdata)

Returns false if printing with a prompt and the user cancels the printing.

Parameter Description
url (String) URL/HTML text to print:
Protocol Prints
html:// The HTML is loaded and printed, e.g. html://<html><head><title>Dynamic Printing</title></head><body>Hello world!</body></html>
any other, e.g. http://, https:// or if no protocol specified The document is downloaded and printed. A relative (to the current page) URL may be given.
Note: The target document at 'url' must NOT be ‘ScriptX-enabled’.
prompt (Bool) Specifies whether or not the user should be prompted before the download is queued
callback Specifies the function to call when various events occur during the processing of the queue entry.
Syntax: callback(status, statusData, callbackdata)
Status Description
1 The request has been queued.
2 Processing of the request has started.
3 The document is being downloaded. The url is in statusData.
4 Document download has completed. The url of the downloaded document is in statusData.
5 The document is being printed.
6 The request has been completed.
-1 An error has occured, statusData will contain a description.
-2 The entry has been abandoned.
callbackdata Specifies the data to pass to the callback function.


Check out the ScriptX print HTML sample.

The following simple but complete example shows how to print an externally-located document: