Basic ScriptX Install

In this sample, the ScriptX object is added to the page with a full codebase including the required version, for example (where [AppServer] is the server root Url):

<object codebase="http://[AppServer]/content/bin/smsx.cab#Version=8,3,0,4" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" id="factory">
</object>

The browser will provide all the UI. In all cases, the browser provides the install UI but in this case there is no assistance on any cause of failure.

Basic Features of ScriptX

Basic ScriptX enables full control of the headers, footers and margins and for providing on page UI for initiating print, preview and page setup.

Some simple script controls print attributes:

<script type="text/javascript">

function MeadCo_ScriptX_Settings() { 
    if ( MeadCo.ScriptX.Init() ) { 
        try {
            MeadCo.ScriptX.Printing.header = "Basic Installation Sample";
            MeadCo.ScriptX.Printing.footer = "&D&b&p of &P";
        } catch (e) { alert("Warning - print setup failed: \n\n" + e.message); }
    } 
    else {
        console.log("Warning : ScriptX failed to initialise in MeadCo_ScriptX_Settings(). Has install failed?"); 
    }
}
</script>

The MeadCo ScriptX Javascript Helper library is also available as a Nuget package or may be downloaded from GitHub. The library provides methods to wrap often used functionality. The library functions and code above can be combined to complete the preview behaviour when the user clicks or taps the button.

<button class="btn btn-default" onclick="MeadCo_ScriptX_Settings(); MeadCo.ScriptX.PrintPage(true); return false;">Print ...</button>
CSS styling will hide this UI from the print ...