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.1.js library simplifies the use of the API.
1 2 3 4 5 6 7 |
< script src = "~/Scripts/jquery-3.1.1.js" ></ script > < script src = "/scripts/meadco-scriptx-1.10.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:
1 2 3 4 5 6 7 8 9 10 11 12 |
$(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.