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.

This page illustrates using the rawPrinting object.

From version 6.3.436, ScriptX supports sending bytes directly to the printer. This is useful for scenarios such as the use of (say) Zebra label printers.

Please use View Source on this page to view the implementation of the example usage.

rawPrinting


Description

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

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

printer


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

printString


Description

Sends the specified text directly to the printer. The string is not rendered in any way, its is sent to the printer for the printer to interpret. In this way, label printing commands or (say) postscript can be sent directly to the printer.

This method is synchronous; it will not return until the print is complete.

Syntax

rawPrinting.printString(sText)

Parameter Description
sText (String) text to print. The string is converted from Unicode to an ANSI string (bytes) and sent as-is to the printer.

Return Value

none.

Applies To

rawPrinting

Examples

The following simple but complete example shows how to print a label to a Zebra printer:

<head>

<!-- MeadCo Security Manager - using evaluation license -->
<object viewastext style="display:none"
classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
codebase="smsx.cab#Version=6,3,436,01">
  <param name="GUID" value="{0ADB2135-6917-470B-B615-330DB4AE3701}">
  <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 printLabel() {
  var p = factory.rawPrinting;
  
  p.printer = "Zebra  LP2844-Z"
  p.printString("^XA^FO50,50^ADN,36,20,^FDScriptX RawPrinting^FS^FO50,100^ADN,36,20,^FDMead & Company^FS^XZ");

}
</script>


</head>

See Also

printDocument

printDocument


Description

Loads the specified file and sends the content directly to the printer. The file bytes are not rendered in any way, they are sent to the printer for the printer to interpret. In this way, postscript can be sent directly to the printer or label printing commands.

This method is synchronous; it will not return until the file load and print is complete.

Syntax

rawPrinting.printDocument(url)

Parameter Description
url (String) url of the file whose contents are to be sent to the printer. The url must be absolute but may refer to local (file://) resources.

Return Value

none.

Applies To

rawPrinting

Examples

The following simple but complete example shows how to print a label stored on the web server to a Zebra printer. The sample is assuming that some process has run on the server to generate and store the required label.

<head>

<!-- MeadCo Security Manager - using evaluation license -->
<object viewastext style="display:none"
classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
codebase="smsx.cab#Version=6,3,436,01">
  <param name="GUID" value="{0ADB2135-6917-470B-B615-330DB4AE3701}">
  <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 printLabel() {
  var p = factory.rawPrinting;
  
  // select the Zebra printer
  p.printer = "Zebra  LP2844-Z"
  
  // must give the full url of the file...
  // The printDocument method is synchronous
  p.printDocument(factory.baseURL("label.txt"));

}
</script>


</head>

See Also

printString


Example

This sample assumes the use of a Zebra printer and will send the given text (ZBL or EPL command sequences) to the selected printer.

 prints a simple label assuming a "Zebra LP 2844-Z" label printer is installed.

Please select the printer to use:
Please enter the string to send:
Appropriate files may also be downloaded from a server and printed: