It appears ScriptX is unavailable or has failed to install.

Has the Infobar appeared?

If you are using Internet Explorer 6 or later on Windows XP SP2 or later then the Explorer Information bar may appear while trying to install ScriptX, it looks like this:

If the bar has appeared, follow the instructions: click on the bar and then select Install ActiveX Control...

Are you an administrator?

ScriptX is code that requires you have administrator rights on your machine in order to install it successfully.

If you are not an administrator, please contact your administrator and ask them to install ScriptX for you.

ScriptX Events

This discussion assumes that you are familiar with the basic principles of controlling printing with ScriptX.

ScriptX fires a number of events in response to actions within the browser, such as the user choosing print preview or a print being completed. This sample illustrates each of these events.

Please note that none of these events will fire as a consequence of calling the printHtml() or batchPrintPDF() APIs; they only apply to operations applied to the current page.

For all events, a handler is installed by setting a ScriptX factory printer object property to the function to be called when the event fires, e.g.

//////////////////////////////////////////////////////////////////////////////
// user selected "Print Privew.." from IE menu or toolbar
function OnUserPrintPreview() {
   if ( !confirm(document.title + "\n\nProceed to Print Preview?") )
      return;
   factory.printing.Preview();
}
factory.printing.onuserprintpreview = OnUserPrintPreview;

The set of available events is as follows:

Property Description
onafterprint Called when print spooling is done. It is similar to the WaitForSpoolingComplete() blocking call, but is asynchronous
onpagesetup Called when the current print or page setup settings are changed on the Internet Explorer Page Setup dialog. Note that this event will also fire during printing.
onuserpagesetup Called when a user invokes the Page Setup... command from Internet Explorer's File menu.
onuserprint Called when a user invokes the Print... command from the Internet Explorer File menu, or presses Print on the document's right-click context menu, or hits the printer button on the toolbar, or presses the Ctrl-P key combination, or when a script calls window.print().
onuserprintpreview Called when a user invokes the Preview... command from the Internet Explorer File menu or activates the print preview button on the toolbar.

 

Sample:

In this document, each of the above handlers is implemented. Try using the various controls such as menu options and toolbar buttons.

It should be noted that for the final three events, the event within Internet Explorer (such as print) is *always* cancelled - by implementing an event handler you take over responsibility for implementing the required behaviour. For example, if the onuserpagesetup is implemented and the page setup dialog is required, perhaps after asking for confirmation, then factory.printing.PageSetup() must be called. It should also be noted that the use of the ScriptX functions for printing, preview etc do not give rise to the events, so, the buttons below will result in the described actions.

 

but, this button, , using the window.print() API call, will result in the event handler: