ScriptX printing: technical manual

July 2008 (Version 6.4.438 and later)


Contents

Overview
Introduction
Summary of examples
Advanced Control of HTML Printing with ScriptX
Technical support
How do I use ScriptX?
Client-side (within Internet Explorer)
Basic functionality: smsx.cab
Advanced functionality: smsx.cab
How to check whether or not the object is properly installed
Testing your print-outs
Server-side deployment
Within a desktop application
Reference

Overview

Introduction

MeadCo's ScriptX is a suite of ActiveX technology components designed to provide absolute control over document printing operations from client and server computers running the Microsoft Windows Web Browsing Platform.

Part of its purpose is to ensure the consistent formatting and appearance of printed output from any local or networked printer, regardless of the printing attributes already set in that computer's Internet Explorer (IE) browser. ScriptX applies a document author's desired attributes at the time of printing browser window or framed content, but thereafter automatically restores all default settings and makes no other permanent changes.

ScriptX 1.0 was introduced by MeadCo in 1998 as a freely distributable utility offering a limited set of print formatting functionality - the scripted control of the printing of HTML frame or window content (with or without a prompt), and the specification by script of printing parameters such as page headers, footers, margins and paper orientation within IE.

That basic functionality is still available at no charge and is freely distributable. Features that are part of that 'free' printing subset are marked in this document as basic.

With the releases of later versions, significantly more advanced printing functionality was introduced which is only accessible in the presence of a paid-for MeadCo publishing license.

Target platform

ScriptX has been tested on and supports Microsoft Windows Web Browsing Platform versions 4.01 SP1 - 7.0 on all Microsoft Windows Win32 OS platforms (including Vista) with the exception of Windows NT 3.51.

Product credits

ScriptX has been widely adopted and acknowledged by the Web and intranet development communities. Check out:

Summary of examples

Feel free to investigate the source code from any of the examples and to cut & paste fragments into your own applications.

Advanced control of HTML Printing with ScriptX

Advanced printing functionality can only be used with a paid-for publishing license. Some of the advanced features enabled with a license are:

Backwards compatibility

All releases of ScriptX are fully backwards compatible with previous releases and for advanced functionality will work with all existing publishing licenses. ScriptX works in close concert with the Microsoft Windows Web Browsing Platform and as a result  is updated to work with all latest releases and patches. All code updates are free; there is never a charge for obtaining the latest code.

We strongly recommend that you update your <OBJECT> elements to reference the current version 6,4,438,06 and update smsx.cab (and replace ScriptX.cab with smsx.cab) on your servers.

What's New

v6.2

Version 6.2 introduces the printerControl, Jobs and Job objects to provide detailed information about the available printers and control of the print queue for a printer. The use of methods that control the print queue requires that the user has administrator rights on the printer.

Also included in this version is an extension of the MeadCo licensing scheme to provide a usable distribution model and allow the use of ScriptX within desktop applications.

v6.3

Version 6.3 provides support for Internet Explorer 7 on Windows XP and Windows Vista; v6.3 is required on the IE 7 platform ... previous versions of ScriptX are not compatible.

This release includes a new print template that provides the same functionality as that within Internet Explorer 7 - scale to fit printing by default and enhanced print preview with draggable margins and switchable headers. This template is available for all versions of Internet Explorer from v5.5 so, whilst your users may be running anything from IE 5.5 onwards, you can give them all a consistent print experience.

The use of the new template is optional - by default ScriptX will use the default template for the platform (IE5.5 style on IE 5.5/IE 6 and IE 7 style on IE7. The particular template required can be specified in script using the templateUrl property or may be specified as a parameter to the ScriptX object.

Frames can now be previewed. This was a MaxiPT only feature but is now also included in the Advanced licensed feature set for ScriptX.

A code review has been undertaken with this release, with APIs checked for behaviour and consistency. This has resulted in some cases where in previous releases a property/method would not report an error when an error occurred - errors are now reported. This may necessitate changes to script code if it was assumed that code would run without error.

v6.3.435

From the first build of this version onwards, ScriptX comes in a single signed CAB - smsx.cab. In addition to fixes for a number of issues, this release introduces improvements for application licenses and the ability to install license updates without requesting permission from the user (this will only occur for updates of an already accepted license).

Two new methods are introduced to provide additional control over the behaviour of the new IE 7 style template. These methods require a publishing license:

v6.3.436

Version 6,3,436 introduces the ability to send raw text to an attached printer. The text is not rendered to the printer, it is interpreted by the printer. This is useful in scenarios such as controlling a thermal label printer. For more information, see rawPrinting.

v6.4.438

ScriptX v6.4 and later no longer support Windows 9x/NT. For maintenance support of these operating systems, please see ScriptX win9xNT/NT Maintainance Mode Binaries.

This release also introduces Enterprise+ licensing and preliminary support for IE8. Please note that this release has been tested against IE 8 Beta 1 only, there are no known problems other than under Vista where there are a number of small issues which will be addressed in future releases of IE/ScriptX.

Finally, a number of problems have been resolved. A development history, as well as latest test versions of ScriptX is available on the ScriptX Beta page.

How do I use the ScriptX object?

Before reading further, please have a look at our illustrative Basic, Advanced and Techie examples of ScriptX printing to get an idea of what ScriptX can do for you.

There are three scenarios in which ScriptX provides the solution for printing of HTML documents with the Microsoft Windows Web Browsing Platform:

  1. Within the Internet Explorer browser, on client-side HTML or XML pages. Here, ScriptX provides full scripted control of the printing experience within IE, allowing choosing the output printer, orientation, page header and footers etc and the initiation of the print. ScriptX is ideal for deployment within web applications hosted within Internet Explorer.
  2. On the server, where ScriptX performs as part of server side request processing, printing an html document loaded from the same or different server.
  3. As part of a desktop application, ScriptX can be used to print HTML documents from the file system, a web server or generated as an 'inline' string.

Note that the use of ScriptX on the server always requires a license. All licenses are available (on request to feedback@meadroid.com) for a trial period to enable full and proper evaluation of the suitability of ScriptX for a particular usage.

Client-side deployment within Internet Explorer.

ScriptX is deployed as a client-side ActiveX control, instantiated and scripted on an HTML or XML page as an <OBJECT> element. Download and installation is a one-time client-side event and is handled automatically by the standard Internet Explorer Component Download technology.

The end user's system must have the "Download Signed ActiveX Controls" and "Script ActiveX control marked as safe for scripting" security settings enabled for the corresponding Security Zone. These are the default settings for the My Computer, Local Intranet, Trusted Sites and Internet Security Zones.

In addition, on Windows 2000 systems and later, the user must be logged on as an Adminsitrator/Power User with the ability to write to the HKEY_LOCAL_MACHINE registry hive and the Windows system folder (typically c:\windows\system32).

If these conditions cannot be met, we suggest you review the Zeepe framework. The Zeepe framework includes ScriptX but is installed via Microsoft Windows Installer technology allowing the components to be installed by users or controlled as part of Corporate software distribution policies. Please note that the ScriptX software included with Zeepe is the same as the stand-alone product, but the ClsIds are changed. An option to only install the ScriptX components of the Zeepe framework is also available - i.e. installation of ScriptX via Windows Installer.

From the first 6,3,435,x version onwards, ScriptX comes in a single signed CAB - smsx.cab - which is part of a download package obtainable from the ScriptX site. The CAB file should be placed on the web server and its location should be referenced by the CODEBASE attribute of the <OBJECT> tag, as shown below.

NOTE: In your own code, we recommend that you place the ScriptX <OBJECT> elements in the document's <BODY> container.

The following code snippets assumes that smsx.cab exists in the same folder as the hosting page itself.

Basic functionality:

<object id=factory viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
  codebase="smsx.cab#Version=6,4,438,06">
</object>

The Basic printing example illustrates the use of the basic printing subset.

The viewastext attribute prevents an authoring tool such as Microsoft FrontPagetm or Visual InterDevtm from running the object at design time.

NOTE: with the 'basic' subset, you can only script header, footer, page margins, paper orientation, Print and PageSetup methods and properties.

Specifying a template (e.g. IE 7)

With version 6.3 and later, you may specify the template to use; this is particularly useful when wishing to provide the Internet Explorer style template (default scaled to fit printing) to users with IE 5.5/6.0 browsers or when specifying the use of the MaxiPT template.

<object id=factory viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
  codebase="smsx.cab#Version=6,4,438,06">
	<param name="template" value="MeadCo://IE7" />
</object>

The ability to specify a particular in-built template is included in the 'basic' subset.

Advanced functionality:

<!-- MeadCo Security Manager -->
<object viewastext style="display:none"
  classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
  codebase="smsx.cab#Version=6,4,438,06">
  <param name="GUID" value="{19CF4AF5-CCD8-4840-BA3C-85EB66D69A6E}">
  <param name="Path" value="sxlic.mlf">
  <param name="Revision" value="0">
</object>

<!-- MeadCo ScriptX -->
<object id=factory viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>

NOTE: the {19CF4AF5-CCD8-4840-BA3C-85EB66D69A6E} value of the GUID parameter used above identifies the MeadCo evaluation license that authors may use to experiment with Advanced printing capabilities. The license validates local filesystem (file://) and local website (http://localhost/) content for evaluation purposes only on a single development computer.

The evaluation license is periodic. It will expire in a few months and will be replaced by a new one with a different GUID, so any code depending on the evaluation license may suddenly stop working at any time.

Registered customers are issued with an unique license identifier and a digitally signed sxlic.mlf license file. See the licensing page for more details.

Check out the sources of the Advanced and Techie printing examples for a complete illustration of how to use licensed ScriptX functionality. The following JScript code snippet shows how to modify printing settings so as to print to a specific printer:

<script defer>
function SetPrintSettings() {
  // -- advanced features
  factory.printing.SetMarginMeasure(2); // measure margins in inches
  factory.printing.printer = "HP DeskJet 870C";
  factory.printing.paperSize = "A4";
  factory.printing.paperSource = "Manual feed";
  factory.printing.collate = true;
  factory.printing.copies = 2;
  factory.printing.SetPageRange(false, 1, 3); // need pages from 1 to 3

  // -- basic features
  factory.printing.header = "This is MeadCo";
  factory.printing.footer = "Advanced Printing by ScriptX";
  factory.printing.portrait = false;
  factory.printing.leftMargin = 1.0;
  factory.printing.topMargin = 1.0;
  factory.printing.rightMargin = 1.0;
  factory.printing.bottomMargin = 1.0;
}

function Print(frame) {
  factory.printing.Print(true, frame) // print with prompt
}
</script>

A subtle JScript syntax issue may occur when setting a printer name that contains back slashes. Don't forget to double the slashes:

factory.printing.printer = "\\\\FS-LYS-01\\HP5n-759" // print to \\FS-LYS-01\HP5n-759

How to check whether or not the object is properly installed

Upon the window.onload event, test whether or not the object property of the ScriptX or the Security Manager object returns as a valid object. The way to do that is shown in the script snippet below.

In the event that you experience any problems with automatic client-side download and installation, check out HOWTO: Find More Information About Why Code Download Failed and Description of Internet Explorer Security Zones Registry Entries as part of your troubleshooting.

<!-- MeadCo Security Manager - using the evaluation license -->
<object id="secmgr" viewastext style="display:none"
classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
codebase="smsx.cab#Version=6,4,438,06">
  <param name="GUID" value="{19CF4AF5-CCD8-4840-BA3C-85EB66D69A6E}">
  <param name="Path" value="sxlic.mlf">
  <param name="Revision" value="0">
</object>

<!-- MeadCo ScriptX -->
<object id="factory" viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>

<script defer>
function window.onload() {
  if ( !factory.object ) {
    alert("MeadCo's ScriptX Control is not properly installed!");
    navigate("scriptx-install-error.htm");
    return;
  }
  if ( !secmgr.object ) {
    alert("MeadCo's Security Manager Control is not properly installed!");
    navigate("secmgr-install-error.htm");
    return;
  }
  if ( !secmgr.validLicense ) {
    alert("The MeadCo Publishing License is invalid or has been declined by the user!");
    navigate("license-error.htm");
    return;
  }
  alert("Ready to script MeadCo's ScriptX!")
}
</script>

Testing your print-outs

The development and testing of code to produce good-looking printed reports usually takes a number of iterations. To save toner, paper, trees and our own precious time :-) we regularly use the FinePrinttm application from FinePrint Software.

FinePrinttm installs a virtual printer driver that serves as indirection layer between the printing application (Internet Explorer in our case) and a physical or networked printer. In 'bypass' mode it lets us accurately preview and repaginate ScriptX-enabled content before it is actually printed or discarded.

It's also a very handy testing device with which to diagnose printing problems. So because we are physically unable to test ScriptX with every model and version of printer and printer driver that exists in the world, we would greatly appreciate it if you would try printing to the FinePrint driver before reporting errors against ScriptX from your particular printing environment.

NOTE: Mead & Co Limited has no commercial affiliation with FinePrint Software, LLC.

Technical support

Licensees of ScriptX' advanced printing functionality are entitled to unlimited direct-to-company email support and access to new versions of the ScriptX software as-and-when issued, both at no additional charge.

Please send us feedback & bug reports.

Web support links

Microsoft Internet Explorer printing and Internet Explorer Component Download support articles:

INFO: WebCast: How Does Internet Component Download Work?

HOWTO: Find More Information About Why Code Download Failed

PRB: Trust Provider Warning Message Appears When You Attempt to Download Components

PROBLEM: Blank Page Is Printed in Internet Explorer 5.5

General information on Internet Explorer printing:

Beyond Print Preview: Print Customization for Internet Explorer 5.5

Print Preview 2: The Continuing Adventures of Internet Explorer 5.5 Print Customization

Print Template Reference

Style Sheets and Printing»

Inside Technique : Printing Techniques»

Printing Tables on Multiple Pages

INFO: Page Break Styles Supported Only with Block Elements


ScriptX printing: technical reference

Unless otherwise indicated by the basic icon, the use of any property or method requires a publishing license.

Objects

Bins, Forms, factory, printing, printerControl, Jobs, Job, rawPrinting

Properties

attributes, bottomMargin, collate, copies, currentPrinter, disableUI, duplex, fontColor, footer, header, isLocal, isNetwork, isShared, Jobs, leftMargin, location, name, onafterprint, onbeforeunload, onpagesetup, onuserpagesetup, onuserprint, onuserprintpreview, pageHeight, pageWidth, paperSize, paperSource, portportrait, printBackground, printer, printer (direct printing), printerControl, printToFileName, rightMargin, serverName, shareName, status, templateURL, topMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

Methods and Functions

BatchPrintPDF, Delete, DefaultPrinter, EnumJobs, EnumPrinters, GetJobsCount, GetMarginMeasure, IsSpooling, IsTemplateSupported, OwnQueue, PageSetup, Pause, Preview, Print, PrintDocument, PrintHTML, PrintPDF, PrintSetup, PrintString, Purge, Restart, Resume, SetMarginMeasure, SetPageRange, SetPrintScale, SetPreviewZoom, Sleep, WaitForSpoolingComplete

Objects

Bins


Description

Lists the available paper sources for a printer. The object is a collection (it can be passed to the JScript Enumerator method or used in a VBScript for..each loop).

The names returned are suitable for use with the paperSource property.

Syntax

oJobs = printerControl.Bins

Properties

Item(nIndex) - returns the name of the paper source item at nIndex
Count - returns the number of available paper sources.

Methods

None.

Example

<script defer>
function listBins() {
	var j = factory.printing.printerControl(factory.printing.DefaultPrinter()).Bins;
	var e = new Enumerator(j);
	var s = "";
	while ( !e.atEnd() ) {
		if ( s.length > 0 ) s+="\n";
		s += e.item(0);
		e.moveNext();
	}
	alert("There are " + j.Count + " available sources:\n\n" + s);
}
<script>

Applies To

printerControl

See Also

paperSource

Forms


Description

Lists the available paper sizes (forms) for a printer. The object is a collection (it can be passed to the JScript Enumerator method or used in a VBScript for..each loop).

The names returned are suitable for use with the paperSize property.

Syntax

oJobs = printerControl.Forms

Properties

Item(nIndex) - returns the name of the paper at nIndex
Count - returns the number of available paper sizes.

Methods

None.

Example

<script defer>
function listForms() {
	var j = factory.printing.printerControl(factory.printing.DefaultPrinter()).Forms;
	var e = new Enumerator(j);
	var s = "";
	while ( !e.atEnd() ) {
		if ( s.length > 0 ) s+="\n";
		s += e.item(0);
		e.moveNext();
	}
	alert("There are " + j.Count + " available paper sizes:\n\n" + s);
}
<script>

Applies To

printerControl

See Also

paperSize

factory


Description

Represents the ScriptX object itself on an HTML page for scripting by its id . For historical reasons, we name it factory.

For WSH or ASP (i.e. server-side) use only, create a ScriptX instance dynamically with the JScript new ActiveXObject» or the VBScript CreateObject».

Note that you can not use CreateObject or new ActiveXObject to call ScriptX client-side. You should call ScriptX in all client-side cases by the id of the on-page ScriptX object.

See How do I use the ScriptX object for deployment details.

Examples

HTML page:

<object id=factory viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="smsx.cab#Version=6,4,438,06">
</object>

WSH script (JScript):

var factory = new ActiveXObject("ScriptX.Factory")
factory.printing.PrintHTML("http://msdn.microsoft.com/workshop/author/script/dhtmlprint.asp")

ASP page (VBScript):

<%
 set factory = CreateObject("ScriptX.Factory")
 factory.printing.PrintHTML "http://localhost/orders/order.asp?number=" & Request.Form("number")
 set factory = nothing
%>

Properties

printing, rawPrinting

printing


Description

Represents the printing functionality of ScriptX. See HTML Printing with ScriptX for more information and examples.

Syntax

printing = factory.printing

Properties

bottomMargin, collate, copies, currentPrinter, disableUI, duplex, footer, header, leftMargin, onafterprint, onbeforeunload, onpagesetup, onuserpagesetup, onuserprint, onuserprintpreview, pageHeight, pageWidth, paperSize, paperSource, portrait, printBackground, printer, printToFileName, rightMargin, templateURL, topMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

Methods

BatchPrintPDF, DefaultPrinter, DoPrint, EnumJobs, EnumPrinters, GetJobsCount, GetMarginMeasure, IsSpooling, IsTemplateSupported, OwnQueue, PageSetup, Preview, Print, PrintHTML, PrintPDF, PrintSetup, PrintXML, SetMarginMeasure, SetPageRange, SetPrintScale, SetPreviewZoom, Sleep, WaitForSpoolingComplete

Applies To

factory

printerControl


Description

Represents the ability to determine a range of printer properties and control the print queue for the printer. Only the exact printer name strings as they appear on Internet Explorer's Print dialog can be specified. If the string does not exist or is written incorrectly then an error will be thrown (e.g. "The printer name is invalid").

Syntax

oControl = factory.printing.printerControl(sPrinterName)

Properties

attributes, Bins, Forms, isLocal, isNetwork, isShared, Jobs, location, name, portserverName, shareName, status

Methods

Pause, Purge, Restart, Resume

Example

<script defer>
function networkServer() {
	var oControl = factory.printing.printerControl(factory.printing.currentPrinter);
	if ( oControl.isNetwork )
		alert("The current printer is on the network server: " + oControl.serverName);
}
<script>

Applies To

printing

rawPrinting (v6.3.436 and later)


Description

Represents the direct printing from within Internet Explorer functionality of ScriptX. Version 6.3.436 or later of ScriptX is required.

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

Direct printing allows for printing to programmable devices such as thermal label printers, whereby a label string can be sent directly to the printer. The Internet Explorer print engine is not used and takes no part in the process. The functionality available from rawPrinting is completely separate from that available from the printing object, and for this reason settings such as printer, paper size, orientation, etc. that may have been set on the printing object for Internet Explorer do not apply to the rawPrinting object.

NOTE: rawPrinting is not supported in any form of usage outside of Internet Explorer.

Syntax

raw = factory.rawPrinting

Properties

printer

Methods

printString, printDocument

Applies To

factory

Jobs


Description

Represents the list of jobs currently in the queue for a printer. The object is a collection (it can be passed to the JScript Enumerator method or used in a VBScript for..each loop).

Syntax

oJobs = printerControl.Jobs

Properties

Item(nIndex) - returns a printJob object for the item at nIndex
Count - returns the number of items in the queue.

Methods

None.

Example

<script defer>
function listJobs() {
	var j = factory.printing.printerControl(factory.printing.DefaultPrinter()).Jobs;
	var e = new Enumerator(j);
	alert("There are " + j.Count + " jobs in the queue");
	while ( !e.atEnd() ) {
		alert("Job name: " + e.item().document);
		e.moveNext();
	}
}
<script>

Applies To

printerControl

See Also

EnumJobs, GetJobsCount

Job


Description

Represents a single job in the queue for a printer. A job is obtained from the list of print jobs available on a printer.

Syntax

oJob = printerControl.Jobs.Item(nIndex)

Properties

All properties are read only:

Property Descripion
document Specifies the name of the print job, typically the title of the html document that has been printed.
machineName Specifies the name of the machine that created the print job.
pagesPrinted Specifies the number of pages that have printed. This value may be zero if the print job does not contain page delimiting information.
position Specifies the job's position in the print queue.
printerName Specifies the name of the printer for which the job is spooled.
size Specifies the size, in bytes, of the job.
status Specifies the job status, can be one or more of the following values:
Meaning Value
JOB_STATUS_PAUSED 0x00000001
JOB_STATUS_ERROR 0x00000002
JOB_STATUS_DELETING 0x00000004
JOB_STATUS_SPOOLING 0x00000008
JOB_STATUS_PRINTING 0x00000010
JOB_STATUS_OFFLINE 0x00000020
JOB_STATUS_PAPEROUT 0x00000040
JOB_STATUS_PRINTED 0x00000080
JOB_STATUS_DELETED 0x00000100
JOB_STATUS_BLOCKED_DEVQ 0x00000200
JOB_STATUS_USER_INTERVENTION 0x00000400
JOB_STATUS_RESTART 0x00000800
statusText A string containing a description of the status. This may be provided by the printer driver or may be generated by ScriptX from the value of status. If generated by ScriptX the description is in English only.
submittedAt Specifies the time when the job was submitted.
totalPages Specifies the number of pages required for the job. This value may be zero if the print job does not contain page delimiting information.
userName Specifies the name of the user who owns the print job.

The value of all properties are determined at the time that the Jobs collection is created, no properties are dynamic (for example a loop inspecting the value of pagesPrinted will not see the value decrease as might be expected).

Methods

Delete, Pause, Restart, Resume

Properties

attributes


Description

Returns the attributes of the printer; can be any reasonable combination of the following values:

Value Meaning
PRINTER_ATTRIBUTE_DEFAULT (0x00000004) Windows 95/98/Me: Indicates the printer is the default printer in the system.
PRINTER_ATTRIBUTE_DIRECT (0x00000002) Job is sent directly to the printer (it is not spooled).
PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST (0x00000200) If set and printer is set for print-while-spooling, any jobs that have completed spooling are scheduled to print before jobs that have not completed spooling.
PRINTER_ATTRIBUTE_ENABLE_BIDI (0x00000800) Windows 95/98/Me: Indicates whether bi-directional communications are enabled for the printer.
PRINTER_ATTRIBUTE_FAX (0x00004000) Windows XP: If set, printer is a fax printer. 
PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS (0x00000100) If set, jobs are kept after they are printed. If unset, jobs are deleted.
PRINTER_ATTRIBUTE_QUEUED (0x00000001) If set, the printer spools and starts printing after the last page is spooled. If not set and PRINTER_ATTRIBUTE_DIRECT is not set, the printer spools and prints while spooling.
PRINTER_ATTRIBUTE_SHARED (0x00000008) Printer is shared.
PRINTER_ATTRIBUTE_WORK_OFFLINE (0x00000400) Windows 95/98/Me: Indicates whether the printer is currently connected. If the printer is not currently connected, print jobs will continue to spool.
PRINTER_ATTRIBUTE_PUBLISHED (0x00002000) Windows 2000/XP: Indicates whether the printer is published in the directory service.
PRINTER_ATTRIBUTE_NETWORK (0x00000010) Printer is a network printer connection.
PRINTER_ATTRIBUTE_LOCAL (0x00000040) Printer is a local printer.
PRINTER_ATTRIBUTE_RAW_ONLY (0x00001000) Indicates that only raw data type print jobs can be spooled.

 

Syntax

attributes = printerControl.attributes

Settings

This is a read only property.

Applies To

printerControl

bottomMarginbasic


Description

Specifies the bottom margin height for HTML print-outs. Cannot be set to be less than the printer's physically unprintable area (unprintableBottom), in which case it will be automatically corrected to the minimum allowed value. If top and bottom margins are set to overlap, they will be corrected to an arbitrary default value of 1/10 of page height.

ScriptX uses the default units of measure of the user's system. In a broad network environment default units are certain to vary (they could be either inches or millimeters) so you may wish to specify a fixed unit of measure with the licensed function SetMarginMeasure.

The bottomMargin property is part of the basic freely-distributable printing subset.

Syntax

printing.bottomMargin = numMargin

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Advanced Printing and ScriptX Techie Printing examples.

See Also

HTML Printing with ScriptX

leftMargin, pageHeight, pageWidth, portrait, rightMargin, topMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

GetMarginMeasure, PageSetup, Print, PrintHTML, SetMarginMeasure

collate


Description

Specifies whether or not to collate the pages of HTML print-outs when more than one copy is printed.

Syntax

printing.collate = true|false

Settings

This is a read/write property. Use true to collate.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

duplex, printer

Print, PrintHTML, PrintSetup

copies


Description

Specifies the number of copies for HTML print-outs.

Syntax

printing.copies = numCopies

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

collate, duplex, printer

Print, PrintHTML, PrintSetup

currentPrinter


Description

Specifies the printer to print to. Only the exact printer name strings as they appear on Internet Explorer's Print dialog can be specified. If the string does not exist or is written incorrectly, printing will be directed to the default printer.

Syntax

printing.currentPrinter = sPrinterName

Settings

This a read/write property. With JScript, take care to double a backslash if one appears in the printer name, as in the example below.

Usage

The internal implementation of writing to the currentPrinter property is the same as writing to the printer property, other than the implementation of currentPrinter does not 'eat' any error. Therefore an error in currentPrinter will be reported in the same way as any other error that occurs in an ActiveX object property/method call.

Example

factory.printing.currentPrinter = "\\\\FS-LYS-01\\HP5n-759" // print to \\FS-LYS-01\HP5n-759

Applies To

printing

See Also

HTML Printing with ScriptX

printer, EnumJobs, EnumPrinters, GetJobsCount, IsTemplateSupported, Print

 

disableUI


Description

Set to true to disable all of Internet Explorer's printing facilities, including the File/Page Setup, File/Print main menu commands, the Print context menu command and the window.print() scripting method. Given this, the only way left to print is via the ScriptX Print and PrintHTML methods.

Syntax

printing.disableUI = true|false

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Advanced Printing example.

See Also

HTML Printing with ScriptX

onpagesetup, onuserpagesetup, onuserprint, onuserprintpreview

PageSetup, Preview, Print, PrintSetup

duplex


Description

Duplex mode (if supported by the targeted printer).

Syntax

printing.duplex = number

Settings

This is a read/write property. Use 1 for simplex mode (no duplex), 2 for vertical duplex, 3 for horizontal duplex.

Applies To

printing

See Also

HTML Printing with ScriptX

collate, copies

Print, PrintHTML, PrintSetup,

footerbasic


Description

Specifies the string to be used as the footer for HTML print-outs. String can include Internet Explorer header/footer metasymbols. If you need to use HTML for your headers and footers, check MaxiPT 1.0» (Internet Explorer 5.5 or later).

The footer property is part of the basic freely-distributable printing subset.

Syntax

printing.footer = sFooter

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Advanced Printing and ScriptX Techie Printing examples.

See Also

HTML Printing with ScriptX

header

PageSetup, Print, PrintHTML

headerbasic


Description

Specifies the string to be used as the header for HTML print-outs. String can include Internet Explrore header/footer metasymbols. If you need to use HTML for your headers and footers, check MaxiPT 1.0» (Internet Explorer 5.5 or later).

The header property is part of the basic freely-distributable printing subset.

To print specific information as part of the header or footer, include the following characters as part of the string:

Shorthand Meaning
&w Window title
&u Page address (URL)
&d Date in short format (as specified by Regional Settings in Control Panel)
&D Date in long format (as specified by Regional Settings in Control Panel)
&t Time in the format specified by Regional Settings in Control Panel
&T Time in 24-hour format
&p Current page number
&P Total number of pages
&& A single ampersand (&)
&b The text immediately following these characters as centered.
&b&b The text immediately following the first "&b" as centered, and the text following the second "&b" as right-justified.

Syntax

printing.header = sHead

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Advanced Printing and ScriptX Techie Printing examples.

See Also

HTML Printing with ScriptX

footer

PageSetup, Print, PrintHTML

isLocal


Description

Returns whether the printer is a local printer (true) or not (false). isLocal tests whether PRINTER_ATTRIBUTE_LOCAL is set in the attributes.

Syntax

bIs = printerControl.isLocal

Settings

This is a read only property.

Applies To

printerControl

isNetwork


Description

Returns whether the printer is a network printer (true) or not (false). isNetwork tests whether PRINTER_ATTRIBUTE_NETWORK is set in the attributes.

Syntax

bIs = printerControl.isNetwork

Settings

This is a read only property.

Applies To

printerControl

isShared


Description

Returns whether the printer is a shared printer (true) or not (false). isShared tests whether PRINTER_ATTRIBUTE_SHARED is set in the attributes.

Syntax

bIs = printerControl.isShared

Settings

This is a read only property.

Applies To

printerControl

leftMarginbasic


Description

Specifies the left margin for HTML print-outs. Cannot be set to be less than the printer's physically unprintable area (unprintableLeft), in which case it will be automatically corrected to the minimum allowed value. If left and right margins overlap, they will be corrected to an arbitrary default value of 1/10 of page width.

ScriptX uses the default units of measure of the user's system. In a broad network environment default units are certain to vary (they could be either inches or millimeters) so you may wish to specify a fixed unit of measure with the licensed function SetMarginMeasure.

The leftMargin property is part of the basic freely-distributable printing subset.

Syntax

printing.leftMargin = numMargin

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Advanced Printing and ScriptX Techie Printing examples.

See Also

HTML Printing with ScriptX

pageHeight, pageWidth, portrait, rightMargin, topMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

GetMarginMeasure, PageSetup, Print, PrintHTML, SetMarginMeasure

location


Description

Returns a string describing the physical location of the printer.

Syntax

sLoc = printerControl.location

Settings

This is a read only property.

Applies To

printerControl

name


Description

Returns a string giving the name of the printer.

Syntax

sName = printerControl.name

Settings

This is a read only property.

Applies To

printerControl

onafterprint


Description

Event handler to be called when print spooling is done. The event is applicable to the results of a Print call but not to that of a PrintHTML call. It can be used to update the user interface accordingly. It is similar to the WaitForSpoolingComplete blocking call, but is asynchronous.

Note the difference between ScriptX's onafterprint event and the DHTML window.onafterprint event: the latter occurs after Internet Explorer has just made a document snapshot for printing and not after the actual print spooling job (see PRB: onafterprint Event Fires Before the Print Dialog Box Appears). So these two events are not interchangeable.

In fact, the DHTML window.onbeforeprint and window.onafterprint exist to give the document's script a chance to customize DHTML content before it goes to print-out or preview (and not to signal actual printing). The same effect can be achieved with the CSS  media=print or media=screen specific styles. Check out the following InsideDHTML.com articles: Printing Techniques, Using CSS to specify alternate document to print out.

Syntax

printing.onafterprint = function_object

Settings

This is a read/write property.

Applies To

printing

Example

<script defer>
factory.printing.onafterprint = AfterPrint;

function AfterPrint() {
  alert("The document has been sent to the print spooler!");
}
</script>

See Also

HTML Printing with ScriptX

onpagesetup, onuserpagesetup, onuserprint, onuserprintpreview

Print, WaitForSpoolingComplete

onbeforeunload


Description

String to prompt a user with when spooling (or a download originated by a PrintHTML call) is still in progress but the page is being closed or navigated away. By default, ScriptX waits 5 seconds in blocking mode to let spooling complete, then prompts the user with the choice to cancel the printing process. The user may decide to wait for another 5 seconds, and so on.

Note: to suppress the prompt you can force the blocking wait state with WaitForSpoolingComplete after any Print or PrintHTML call or before leaving the page. However the use of WaitForSpoolingComplete() after each PrintHTML call in a sequence of calls is not recommended. Use it only after the last call in the sequence.

Syntax

printing.onbeforeunload = string

Settings

This is a read/write property.

Applies To

printing

See Also

HTML Printing with ScriptX

Print, PrintHTML, WaitForSpoolingComplete

onpagesetup


Description

Event handler to be called when the current print or page setup settings are changed on the Internet Explorer Page Setup dialog. 

Use it to update the page's user interface accordingly. This is exactly what the ScriptX Techie Printing example does.

Syntax

printing.onpagesetup = function_object

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

disableUI, onafterprint, onuserpagesetup, onuserprint, onuserprintpreview

PageSetup

onuserpagesetup


Description

Event handler to be called when a user invokes the Page Setup... command from Internet Explorer's File menu. 

You may cancel this operation within the event handler simply by returning, or you may call PageSetup to provide the expected behavior. In the latter case, once the user has made changes on the Page Setup dialog an onpagesetup event will be fired to update the page's user interface. ScriptX Techie Printing implements this behavior.

Syntax

printing.onuserpagesetup = function_object

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

disableUI, onafterprint, onpagesetup, onuserprint, onuserprintpreview

PageSetup

onuserprint


Description

Event handler to be 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().

You may cancel this operation within the event handler simply by returning, or you may call Print to provide the expected behavior. ScriptX Techie Printing implements this behavior.

Syntax

printing.onuserprint = function_object

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

disableUI, onafterprint, onpagesetup, onuserpagesetup, onuserprintpreview

PageSetup

onuserprintpreview


Description

Event handler to be called when a user invokes the Preview... command from the Internet Explorer File menu or hits the print preview button on the toolbar.

You may cancel this operation within the event handler simply by returning, or you may call Preview to provide the expected behavior. ScriptX Techie Printing implements this behavior.

Syntax

printing.onuserprintpreview = function_object

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

disableUI, onafterprint, onpagesetup, onuserpagesetup, onuserprint

PageSetup

pageHeight


Description

Returns the physical height of the current printer paper selection.

ScriptX uses the default units of measure of the user's system. In a broad network environment default units are certain to vary (they could be either inches or millimeters) so you may wish to specify a fixed unit of measure with the licensed function SetMarginMeasure.

Syntax

height = printing.pageHeight

Settings

This is a read-only property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

bottomMargin, leftMargin, pageWidth, paperSize, portrait, rightMargin, topMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

PageSetup, SetMarginMeasure

pageWidth


Description

Returns the physical width of the current printer paper selection.

ScriptX uses the default units of measure of the user's system. In a broad network environment default units are certain to vary (they could be either inches or millimeters) so you may wish to specify a fixed unit of measure with the licensed function SetMarginMeasure.

Syntax

width = printing.pageWidth

Settings

This is a read-only property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

bottomMargin, leftMargin, pageHeight, paperSize, portrait, rightMargin, topMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

PageSetup, SetMarginMeasure

paperSize


Description

Specifies the paper size for HTML print-outs by its string name. ScriptX tries to find the longest string match amongst the list of available paper size names for the current printer. Read back the paperSize value to see the actual result.

Syntax

printing.paperSize = sPaperSize

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

Forms, pageHeight, pageWidth, paperSource, portrait, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

PageSetup, Print, PrintHTML, PrintSetup,

paperSource


Description

Specifies the paper source (tray) for HTML print-outs by its string name. ScriptX tries to find the longest string match amongst the list of available paper source names for the current printer. Read back the paperSource value to see the actual result.

Syntax

printing.paperSource = sPaperSource

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

Bins, paperSize

PageSetup, Print, PrintHTML, PrintSetup

port


Description

Returns a string string that identifies the port(s) used to transmit data to the printer. If a printer is connected to more than one port, the names of each port will be separated by commas (for example, "LPT1:,LPT2:,LPT3:").

Windows 95/98/Me: This member can specify only one port because multiple ports per printer are not supported.

Syntax

sName = printerControl.port

Settings

This is a read only property.

Applies To

printerControl

portraitbasic


Description

Specifies the page orientation for HTML print-outs.

The portrait property is part of the basic freely-distributable printing subset.

Syntax

printing.portrait = true|false

Settings

This is a read/write property. Use true to specify portrait and false for landscape.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

bottomMargin, leftMargin, pageHeight, pageWidth, paperSize, templateURL, topMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

PageSetup, Print, PrintHTML, PrintSetup

printBackground


Description

Specifies whether or not to print a page's background colors and images.

Syntax

printing.printBackground = true|false

Settings

This is a write-only property.

Applies To

printing

Example

Check out the source code of the ScriptX Techie Printing example.

See Also

HTML Printing with ScriptX

Preview, Print, PrintHTML

printer


Description

Specifies the printer to print to. Only the exact printer name strings as they appear on Internet Explorer's Print dialog can be specified. If the printer specified does not exist or is written incorrectly, printing will be directed to the default printer.

Syntax

printing.printer = sPrinterName

Settings

This a write-only property. With JScript, take care to double a backslash if one appears in the printer name, as in the example below.

Please note that providing an invalid name will not raise an error - the request will be ignored and the printer to use remain unchanged. To trap errors specifying the printer to use, use the currentPrinter property.

Applies To

printing

Example

factory.printing.printer = "\\\\FS-LYS-01\\HP5n-759" // print to \\FS-LYS-01\HP5n-759

Also check out the source code of the ScriptX Techie Printing example.

SSee Also

HTML Printing with ScriptX

rawPrinting

bottomMargin,collate, copies, currentPrinter, duplex, footer, header, leftMargin, paperSize, paperSource, portrait, printBackground, printToFileName, rightMargin, templateURL, topMargin

DefaultPrinter, EnumJobs, EnumPrinters, GetJobsCount, IsSpooling, IsTemplateSupported, PrintHTML, PrintSetup, SetPageRange, WaitForSpoolingComplete

printer  (v6.3.436 and later)


Description

Specifies the printer to directly print to. Only the exact printer name strings as they appear in the Printers Control Panel may be used.

Syntax

rawPrinting.printer = sPrinterName

Settings

This a read-write property. With JScript, take care to double a backslash if one appears in the printer name.

Please note that an error will be thrown if the printer cannot be connected to.

Applies To

rawPrinting

Example

factory.rawPrinting.printer = "Zebra  LP2844-Z"

See Also

printString, printDocument

 

printToFileName


Description

The file name to print to. Use the full path specification. The file created doesn't accumulate subsequent print-outs and - for security reasons - doesn't get overwritten if it already exists. Specify a new filename for each new print-out.

Printing to file name is supported for Internet Explorer 5.0 and later.

Syntax

printing.printToFileName = sPathFileName

Settings

This is a read/write property. With JScript, take care to double a backslash if one appears in the file path, as in the example below. An empty string indicates that the print-out should go to the printer driver.

Applies To

printing

Example

factory.printing.printToFileName = "d:\\temp\\printout.prn"

See Also

HTML Printing with ScriptX

printer

IsSpooling, Print, PrintHTML, PrintSetup, WaitForSpoolingComplete

rightMarginbasic


Description

Specifies the right margin for HTML print-outs. Cannot be set to be less than the printer's physically unprintable area (unprintableRight), in which case it will be automatically corrected to the minimum allowed value. If left and right margins overlap, they will be corrected to an arbitrary default value of 1/10 of page width.

ScriptX uses the default units of measure of the user's system. In a broad network environment default units are certain to vary (they could be either inches or millimeters) so you may wish to specify a fixed unit of measure with the licensed function SetMarginMeasure.

The rightMargin property is part of the basic freely-distributable printing subset.

Syntax

printing.rightMargin = numMargin

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Advanced Printing and ScriptX Techie Printing examples.

See Also

HTML Printing with ScriptX

pageHeight, pageWidth, portrait, leftMargin, topMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

GetMarginMeasure, PageSetup, Print, PrintHTML, SetMarginMeasure

serverName


Description

Returns a string giving the name of the server computer controlling the printer. If the string is empty then the printer is controlled locally.

Syntax

sName = printerControl.serverName

Settings

This is a read only property.

Applies To

printerControl

shareName


Description

Returns a string identifying the share point of the printer. This value is only present if PRINTER_ATTRIBUTE_SHARED is set on attributes.

Syntax

sName = printerControl.shareName

Settings

This is a read only property.

Applies To

printerControl

status


Description

Specifies the status of the printer, it can be any reasonable combination of the following values.

Value Meaning
PRINTER_STATUS_BUSY (0x00000200) The printer is busy.
PRINTER_STATUS_DOOR_OPEN (0x00400000) The printer door is open.
PRINTER_STATUS_ERROR (0x00000002) The printer is in an error state.
PRINTER_STATUS_INITIALIZING (0x00008000) The printer is initializing.
PRINTER_STATUS_IO_ACTIVE (0x00000100) The printer is in an active input/output state
PRINTER_STATUS_MANUAL_FEED (0x00000020) The printer is in a manual feed state.
PRINTER_STATUS_NO_TONER (0x00040000) The printer is out of toner.
PRINTER_STATUS_NOT_AVAILABLE (0x00001000) The printer is not available for printing.
PRINTER_STATUS_OFFLINE (0x00000080) The printer is offline.
PRINTER_STATUS_OUT_OF_MEMORY (0x00200000) The printer has run out of memory.
PRINTER_STATUS_OUTPUT_BIN_FULL (0x00000800) The printer's output bin is full.
PRINTER_STATUS_PAGE_PUNT (0x00080000) The printer cannot print the current page.

Windows 95/98/Me: Indicates the page is being "punted" (that is, not printed) because it is too complex for the printer to print.

PRINTER_STATUS_PAPER_JAM (0x00000008) Paper is jammed in the printer
PRINTER_STATUS_PAPER_OUT (0x00000010) The printer is out of paper.
PRINTER_STATUS_PAPER_PROBLEM 0x00000040) The printer has a paper problem.
PRINTER_STATUS_PAUSED (0x00000001) The printer is paused.
PRINTER_STATUS_PENDING_DELETION (0x00000004) The printer is being deleted.
PRINTER_STATUS_POWER_SAVE (0x01000000) The printer is in power save mode.
PRINTER_STATUS_PRINTING (0x00000400) The printer is printing.
PRINTER_STATUS_PROCESSING (0x00004000) The printer is processing a print job.
PRINTER_STATUS_SERVER_UNKNOWN (0x00800000) The printer status is unknown.
PRINTER_STATUS_TONER_LOW (0x00020000) The printer is low on toner.
PRINTER_STATUS_USER_INTERVENTION (0x00100000) The printer has an error that requires the user to do something.
PRINTER_STATUS_WAITING (0x00002000) The printer is waiting.
PRINTER_STATUS_WARMING_UP (0x00010000) The printer is warming up.

Syntax

printerControl.status = nStatus

Settings

This is a read/write property. The user will require printer administrator writes in order to update the status.

Applies To

printerControl

templateURLbasic (v6.3 and later)


Description

Specifies the URL of a custom Print Template for Internet Explorer 5.5 or later. Internet Explorer will use the specified template for all its printing operations. 

For ScriptX v6.3 and later, this property is also available as basic  property, provided the value set is one of the following special values

Value Description
MeadCo://IE55The IE 5.5/IE 6 style template - note can be used on IE 7.
MeadCo://IE7The IE 7 style template - note free usage on all versions of IE 5.5 or later.
MeadCo://DefaultThe default template for the IE version in use, i.e. the template matches the browser version. This is the default behaviour.
MeadCo://maxiptThe MaxiPT template (requires a license).

If you use your own templates with ScriptX, make sure that you insert a MeadCo's TriPrint Helper <OBJECT> into the <HEAD> section of the print template source:

<HTML XMLNS:IE>
<HEAD>
<?IMPORT namespace="ie" implementation="#default">

<!-- <TriPrint> (c) 2000, 2001 by Mead & Co Limited <triprint@meadroid.com> -->
<object classid="clsid:1663ed6a-23eb-11d2-b92f-008048fdd814" viewastext>
  <param name="__PX__template" value="true">
</object>
<!-- </TriPrint> -->

<TITLE>Print Preview</TITLE>

Syntax

printing.templateURL = templateURL

Settings

This is a read/write property.

Applies To

printing

Example

Read more about MeadCo's in-depth support for Print Templates.

See Also

IsTemplateSupported, Print, PrintHTML

topMarginbasic


Description

Specifies the top  margin for HTML print-outs. Cannot be set to be less than the printer's physically unprintable area (unprintableTop), in which case it will be automatically corrected to the minimum allowed value. If top and bottom margins overlap, they will be corrected to default value of 1/10 of page width.

ScriptX uses the default units of measure of the user's system. In a broad network environment default units are certain to vary (they could be either inches or millimeters) so you may wish to specify a fixed unit of measure with the licensed function SetMarginMeasure.

The topMargin property is part of the basic freely-distributable printing subset.

Syntax

printing.topMargin = numMargin

Settings

This is a read/write property.

Applies To

printing

Example

Check out the source code of the ScriptX Advanced Printing and ScriptX Techie Printing examples.

See Also

HTML Printing with ScriptX

leftMargin, pageHeight, pageWidth, portrait, rightMargin, bottomMargin, unprintableBottom, unprintableLeft, unprintableRight, unprintableTop

GetMarginMeasure, PageSetup, Print, PrintHTML, SetMarginMeasure

unprintableBottom


Description

Returns the bottom unprintable page area (in current system measure units, inches or millimeters) for the current printer. It indicates the distance from the bottom edge of the page where no printing may occur.

Syntax

numMargin = printing.unprintableBottom

Settings

This is a read/only property.

Applies To

printing

See Also

HTML Printing with ScriptX

bottomMargin, leftMargin, pageHeight, pageWidth, paperSize, topMargin, unprintableLeft, unprintableRight, unprintableTop

PageSetup, Print, PrintSetup

unprintableLeft


Description

Returns the left unprintable page area (in current system measure units, inches or millimeters) for the current printer. It indicates the distance from the left edge of the page where no printing may occur.

Syntax

numMargin = printing.unprintableLeft

Settings

This is a read/only property.

Applies To

printing

See Also

HTML Printing with ScriptX

bottomMargin, leftMargin, pageHeight, pageWidth, paperSize, topMargin, unprintableBottom, unprintableRight, unprintableTop

PageSetup, Print, PrintSetup

unprintableRight


Description

Returns the right unprintable page area (in current system measure units, inches or millimeters) for the current printer. It indicates the distance from the right edge of the page where no printing may occur.

Syntax

numMargin = printing.unprintableRight

Settings

This is a read/only property.

Applies To

printing

See Also

HTML Printing with ScriptX

bottomMargin, leftMargin, pageHeight, pageWidth, paperSize, topMargin, unprintableBottom, unprintableLeft, unprintableTop

PageSetup, Print, PrintSetup

unprintableTop


Description

Returns the top unprintable page area (in current system measure units, inches or millimeters) for the current printer. It indicates the distance from the top edge of the page where no printing may occur.

Syntax

numMargin = printing.unprintableTop

Settings

This is a read/only property.

Applies To

printing

See Also

HTML Printing with ScriptX

bottomMargin, leftMargin, pageHeight, pageWidth, paperSize, topMargin, unprintableBottom, unprintableLeft, unprintableRight

PageSetup, Print, PrintSetup



Methods and Functions

BatchPrintPDF


Description

Downloads Adobe Acrobattm or Microsoft Officetm files and prints them out in batch mode in the background. Any number of print-outs can be queued. As of the present release of ScriptX, BatchPrintPDF prints only on the default printer using default settings.

To print PDF files, the Adobe Acrobat Readertm 4.0 or later should be present on the client system. It can be freely downloaded from the Adobe website.

Please note: This method uses DDE to converse with  Adobe Acrobat Readertm  and is known to work well with Adobe Acrobat Readertm versions 4 and 5 - problems may be encountered with Adobe Acrobat Readertm 6 (due to security restrictions introduced in Adobe Acrobat Readertm v6 it is possible for the user to [accidentally] disable printing altogether) and problems will almost certainly be encountered with Adobe Acrobat Readertm 7 and later to the extent that printing does not work at all or is intermittent. In other words, for v6 and later "your mileage may vary". We strongly recommend that if you intend to use this functionality of ScriptX you obtain an evaluation license and test your usage scenarios very carefully.

Use IsSpooling to check if there are any outstanding downloads in the queue created by BatchPrintPDF. Use WaitForSpoolingComplete to wait for all documents to be downloaded and spooled.

Syntax

printing.BatchPrintPDF(url)

Example

Here is a basic example of BatchPrintPDF use

<body>

<!-- MeadCo Security Manager - using evaluation license -->
<object viewastext style="display:none"
classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
codebase="smsx.cab#Version=6,4,438,06">
  <param name="GUID" value="{19CF4AF5-CCD8-4840-BA3C-85EB66D69A6E}">
  <param name="Path" value="sxlic.mlf">
  <param name="Revision" value="0">
</object>

<!-- MeadCo ScriptX -->
<object id="factory" viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>

<script defer>
function window.onload() {
  idPrint.disabled = false;
}

function BatchPrintPDF(url) {
  factory.printing.BatchPrintPDF(url);
}
</script>

<input id=idPrint disabled type="button" value="PrintHTML('info.htm')"
 onclick="BatchPrintPDF('report.pdf')">

</body>

Applies To

printing

See Also

HTML Printing with ScriptX

DefaultPrinter, EnumJobs, EnumPrinters, GetJobsCount, IsSpooling, PrintHTML, PrintPDF, Sleep, WaitForSpoolingComplete

DefaultPrinter


Description

Returns the name of the default printer (if any).

Syntax

printerName = printing.DefaultPrinter()

Applies To

printing

See Also

HTML Printing with ScriptX

printer

EnumJobs, EnumPrinters, GetJobsCount, IsTemplateSupported, Print

DoPrint


Description

The alias for the Print method (retained for compatibility reasons).

Applies To

factory

See Also

printing, Print, PrintHTML

EnumJobs


Description

Enumerates active jobs on the given printer.

Syntax

var jobName = {}
status = printing
.EnumJobs(printerName, index, jobName)

Parameter Description
printerName (String) printer name on which to enumerate the jobs
index (Number) Zero-based index of the job. Increment this value for each new EnumJobs call for a given printerName
An index of -1 will return the status of the printer, rather than a particular job.
jobName (Object) obtains a name for the job (available as jobName[0])

Return Value

Returns a numeric value indicating the current status of the job. The bits have the following meaning:

Meaning Value
JOB_STATUS_PAUSED 0x00000001
JOB_STATUS_ERROR 0x00000002
JOB_STATUS_DELETING 0x00000004
JOB_STATUS_SPOOLING 0x00000008
JOB_STATUS_PRINTING</