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.10.8.js library simplifies the use of the API.
<script src="~/Scripts/jquery-3.1.1.js"></script> <script src="/scripts/meadco-scriptx-1.10.8.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 () {
MeadCo.ScriptX.InitAsync()
.then(function() {
$("#btn-print").click(function(e) {
MeadCo.ScriptX.DirectPrintDocument("ZDesigner LP 2844-Z","/Labels/Parcel?trackid=415128");
});
})
.catch(function(e) {
app.Messages.ErrorBox("Unable to initialise 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.