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. |
Example
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=8,3,0,4">
<param name="GUID" value="{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}">
<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 & Co^FS^XZ");
}
</script>
</head>