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,6,440,26">
  <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