Introduction to printing snippets of html

Typically, ScriptX is used to print the whole of the document displayed in the current window or frame or a document downloaded from a server.

The printing of 'snippets' of HTML or documents constructed using javascript on the client device is possible by using the "e;html://" pseudo protocol. "e;html://" is recognised by the ScriptX method PrintHtmlEx() as a request to print the remainder of the string as HTML.

When the PrintHTMLEx method is used, headers, footers, papersize etc etc, i.e. all the usual formatting and presentation properties are used to print the downloaded document:

A string can then be printed:

<div style="white-space:nowrap;height:10mm;position:absolute;right:-9mm;top:10mm;width:30mm;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);"><span>Hello world</span></div>

function printSnippet() {
    var snippet = "<div style="white-space:nowrap;height:10mm;position:absolute;right:-9mm;top:10mm;width:30mm;
                    -webkit-transform:rotate(90deg); -ms-transform:rotate(90deg);transform:rotate(90deg);
                    "><span>Hello world</span></div>";

    factory.printing.PrintHtmlEx("html://" + snippet",false);
}