Client Side Printing Samples

ScriptX is continually under development, with not only fixes for faults but with new features taking advantage of the evolving web browsing platform from Microsoft.

The samples too continually evolve as a result of feedback from customers. Many samples are based on real-world examples of ScriptX usage.

All our samples now make extensive use of jQuery. This aids in clearly separating the function in script from the presentation of the document.

We provide two sets of examples:

Basic

The Basic samples use only the free sub-set of ScriptX functionality, but never the less illustrate the power, flexibility and end-user usability enhancement that is provided by deployment of ScriptX on your documents.

Functionality available in the free subset

Basic

Illustrates the straightforward use of the freely distributable basic ScriptX printing functionality to set page headers and footers, paper orientation.

'Wide' Basic'

Illustrates the straightforward use of the freely distributable basic ScriptX printing functionality. The page to be printed is very wide - this sample illustrates the new 'Scale to fit' functionality that will be available as standard with IE7 and ScriptX makes available to IE5.5 and IE6 users. The sample also illustrates changing the template type in use.

No ScriptX Basic

Illustrates the simple page without ScriptX.

IE 7 Basic

Illustrates the simple page in an old document mode.

IE 7 Wrapped iFrame

Illustrates the simple page in an old document mode inside an iFrame.

ScriptX with frames

Provides a discussion of using ScriptX with framesets including printing of individual frames.

Note that the structure of the html document for this sample does not work with IE 10 or later standards mode so the document mode will be set to IE9 standards mode in these cases.

Always IE 7 Template

Illustrates the use of the freely distributable ScriptX printing component to provide the IE 7 printing experience on all versions of IE from v5.5 onwards. No scripting is used to alter headers and footers etc.

Header and Footer Font

Illustrates scripted control of the font used to print the document header and footer. User/scripted defined fonts for headers and footers requires Internet Explorer 8 or later and ScriptX 6.5.439 or later.

ScriptX Installed Version Information

Illustrates how to obtain the version of ScriptX installed on a machine - this sample will not attempt to install a new version of ScriptX or upgrade any current installation.

 

Licensed

The Licensed samples illustrate the full power of ScriptX controlled printing within Internet Explorer, from promptless printing to batch printing of documents both HTML and Acrobat all with control of the printer, paper size and much more.

Licensed functions

Main Features

Advanced

Illustrates the typical use of ScriptX advanced printing functionality for which a publishing license is required.

Techie

An all-in-one technical example illustrating the most advanced use of licensed ScriptX functionality.

Reports

Provides a discussion of printing customised documents and reports with ScriptX and a number of samples of differing techniques. A mix of free and licensed functionality is used; the licensed functions provide an improved user experience..

Printer connections (requires v7.1 or later)

AddPrinterConnection and DeletePrinterConnection allow connections to be made to printers that are shared on the network but may not be in the users installed devices.

Printer control

Illustrates the use of the printerControl, Jobs and Job objects.

Direct (raw) printing (requires v6.3.436 or later)

Discusses sending data directly to the printer in scenarios such as sending ZBL commands to a Zebra Label printer or control code sequences to label printers.

Note: Direct printing is a cost-option which can be enabled on a 'standard' client-side license for an additional fee of $500.

Printing PDF Files (v7.1 or later)

Discusses printing of Adobe Acroobat PDF files using the new features available in ScriptX Corporate Edition 7.1 and later.

Note: Enhanced PDF printing is a cost-option which can be enabled on a 'standard' client-side license for an additional fee of $500.

Print client side generated HTML

Illustrates creating an html document on the client as a javascript string and then printing that html.

PrintHTML callbacks (requires v7 or later)

The PrintHTML API provides for queueing and printing of html documents in the background. ScriptX 7 and later adds the PrintHTMLEx API that provides callbacks on the progress of each job, allowing monitoring and error checking.

Working with frames

Frame (iframe) preview

The 'Wide' Basic sample but licensed, so conferring the ability to preview iframed content. This requires the use of the IE 7 style template.

ScriptX with frames

Provides a discussion of using ScriptX with framesets including printing of individual frames. This sample also illustrates previewing a frame.

Note that the structure of the html document for this sample does not work with IE 10 or later standards mode so the document mode will be set to IE9 standards mode in these cases.

ScriptX within a frame in frameset

Provides a discussion of using ScriptX with framesets where a particular individual frame is to be printed/previewed and ScriptX is placed on the document within the frame rather than the top most frameset document. This sample includes using MaxiPT.

Please note that this sample does work with IE 10 and laters standards mode.

ScriptX within an iframe

Provides a discussion of using ScriptX where a particular individual iframe is to be printed/previewed and ScriptX is placed on the document within the (i)frame rather than the top most frameset document. This sample includes using MaxiPT.

Controlling margins, printing and previewing frames

In an international environment there may be a mixture of margin measurement units - this sample sets margins in the opposite units to your default illustrating that with ScriptX you gain control of the units for specifying measurements. This sample also illustrates the scaled to fit preview and printing of a frame.

Enhanced formatting (requires v7 or later, IE 8 or later)

Enhanced formatting provides for finer control over the headings and footers by allowing HTML snippets to be used, and for an enhanced page range specification.

Note: Enhanced formatting is a cost-option which can be enabled on a 'standard' client-side license for an additional fee of $500.

Headers and footers

Illustrates the use of multi-line HTML headers and footers.

Page ranges

This sample shows the use of enhanced page range specification; the ability to print arbitrary ranges of pages (rather than a single range) and print only odd, only even or both odd and even numbered pages.

Techie

An all-in-one sample by which you can explore the effect on output of each of the enhanced formatting options. This sample starts with example enhanced headers and footers filled in.

Blank Techie

An all-in-one sample by which you can explore the effect on output of each of the enhanced formatting options. This sample starts without any example data.

Queued printing (requires 7.0.18.1 or later)

This sample shows the use of enhanced formatting with the queued printing method printHTML().

Interactive report selection and dynamic enhanced formatting

A 'walk-thru' demo illustrating ScriptX Enhanced Formatting HTML header and (in this case, hidden) frame printing capabilties all wrapped in a modal dialog window.

Miscellaneous illustrations

Automating preview

Illustrates calling for a preview during the initialisation of the page taking the user straight to the preview from which they can then print.

Use of OwnQueue

Provides a discussion of the usage of the OwnQueue() method with the printHtml() method for printing reports.

ScriptX Events

ScriptX fires a number of events, such as when the user chooses print preview and when printing has completed. This short article illustrates each of these events.

Printing the selection or range of pages

Discusses the SetPageRange() method that provides for printing only the selected content, or a range of pages.

Preview Zoom (requires ScriptX 6.3.435 or later)

Illustrates setting a custom zoom factor for print preview.

Print scaling (requires ScriptX 6.3.435 or later)

Illustrates specifying the print scaling to use. This requires the IE 7 style template and enables overriding the default of 'scale to fit'/100%.

Determining the number of pages to be printed (requires v7 or later)

Illustrates obtaining the totalPrintPages property.

Persistent unique identifier (requires ScriptX 7.1 or later)

Illustrates using the persistent Unique identifier.