Printing ZPL from a file

The Direct/RAW printing capability is intended for sending byte streams of printer control scripts in a language such as ZPL. It is assumed that the correct paper is loaded to the printer so the  API is simple, providing for selecting a printer and then sending a string or the content returned from a url.

The use of the ScriptX Client libraries that emulate the Add-on API means the same code can be written for all browsers and the meadco-scriptx-1.8.1.js library simplifies the use of the API.

<script src="~/Scripts/jquery-3.1.1.js"></script>
<script src="/scripts/meadco-scriptx-1.8.1.js" type="text/javascript"></script>
<script src="/scripts/meadco-core.js"></script>
<script src="/scripts/meadco-scriptxprint.js"></script>
<script src="/scripts/meadco-scriptxfactory.js"></script>
<script src="/scripts/meadco-scriptxprintlicensing.js"></script>
<script src="/scripts/meadco-secmgr.js"></script>

Then the same code works:

$(window).on("load", function () {
    var sLabel = "^XA^FO50,50^ADN,36,20,^FDScriptX RawPrinting^FS^FO50,100^ADN,36,20,^FDMead & Company^FS^XZ";
    MeadCo.ScriptX.InitAsync()
        .then(function() {
            $("#btn-print").click(function(e) {
                MeadCo.ScriptX.DirectPrintString("ZDesigner LP 2844-Z",sLabel);
            });
        })
        .catch(function(e) {
            app.Messages.ErrorBox("Unable to intialise ScriptX: " + e);
        });
    });
});
    

The Direct/RAW printing capability is intended for sending byte streams of printer control scripts in a language such as ZPL. It is assumed that the correct paper is loaded to the printer so the API is simple, providing for selecting a printer and then sending a string or the content of a file.

Please select a ZPL compatible printer:  Print: