Migrating to JSPrintManager 5.0 from older versions
The brand new JSPrintManager 5.0 is compatible with older versions but a few modifications must be done to get JSPM v5.0 working on an existing project using older versions.
Migration steps (valid for any older version)
Be sure you refresh the script file references to use JSPrintManager.js 5.0
Be sure to install on each of the client machines the JSPM App 5.0 available at https://neodynamic.com/downloads/jspm (JSPM App 5.0 run side by side with older versions)
Migration steps depending of the older version
Migrating from v4.0
- No extra steps are required!
Migrating from v3.0
- Just be aware that WIA & Old TWAIN 1.x scanner drivers are supported only if the client installs the 32-bit version of the JSPM App.
Migrating from v2.0
- Serial Port Data Bits is now an enumeration called JSPM.Serial.DataBits
- JSPM.WSStatus.Blacklisted renamed to JSPM.WSStatus.Blocked
Migrating from v1.0
- Serial Port Data Bits is now an enumeration called JSPM.Serial.DataBits
- JSPM.WSStatus.Blacklisted renamed to JSPM.WSStatus.Blocked
- JSPM websocked is available when JSPM.JSPrintManager.start() succeed. A sample code for v1.0 would look like the following:
<script type="text/javascript">
JSPM.JSPrintManager.start()
.then(_ => {
var cpj = new JSPM.ClientPrintJob();
cpj.clientPrinter = new JSPM.DefaultPrinter();
var my_file = new JSPM.PrintFile('/images/penguins300dpi.jpg', JSPM.FileSourceType.URL, 'MyFile.jpg', 1);
cpj.files.push(my_file);
cpj.sendToClient();
})
.catch((e) => {
alert(e);
});
</script>
In v5.0, JSPM Websocket status must be verified in the JSPM.JSPrintManager.WS.onStatusChanged event. The above code for v1.0 can be converted to v5.0 as follows:
<script type="text/javascript">
JSPM.JSPrintManager.auto_reconnect = true;
JSPM.JSPrintManager.start();
JSPM.JSPrintManager.WS.onStatusChanged = function () {
if (JSPM.JSPrintManager.websocket_status == JSPM.WSStatus.Open) {
var cpj = new JSPM.ClientPrintJob();
cpj.clientPrinter = new JSPM.DefaultPrinter();
var my_file = new JSPM.PrintFile('/images/penguins300dpi.jpg', JSPM.FileSourceType.URL, 'MyFile.jpg', 1);
cpj.files.push(my_file);
cpj.sendToClient();
}
};
</script>
That's all! If you have troubles migrating to v5.0, then contact our dev team at https://neodynamic.com/support