The basic code sample on your website deploys the app using the applet function.
<input type=button onClick="print()" value="Print">
<applet id="qz" name="QZ Print Plugin" code="qz.PrintApplet.class" archive="./qz-print.jar" width="100" height="100">
<param name="printer" value="zebra">
</applet>
<script>
function print() {
var qz = document.getElementById('qz');
qz.append('A37,503,0,1,2,3,N,PRINTED USING QZ-PRINT\n');
// ZPLII
// qz.append('^XA^FO50,50^ADN,36,20^FDPRINTED USING QZ-PRINT^FS^XZ');
qz.print();
}
</script>
When I attempt to run this in my current environment (Chrome 43.0.2357.65 m / Java 8u45) I receive the following error:
General Exception
Name: QZ Print Plugin
SecurityException: JAR should not contrain JNLP-INF/APPLICATION.JNLP
After doing some research the issue seems to be that newer versions of chrome require that the app be launched as a JNLP. Based on info I found, I tried using this code instead, but it returning an uncaught syntaxerror: unexpected token = on line 5.
<input type=button onClick="print()" value="Print">
<script src="
https://www.java.com/js/deployJava.js"></script>
<script>
var attributes = { id='qz', archive='./qz-print.jar', name='QZ Print Plugin', code='qz.PrintApplet.class', width:55, height:55 };
var parameters = { jnlp_href: 'qz-print_jnlp.jnlp', cache_option: 'plugin', disable_logging: 'false', initial_focus: 'false' };
deployJava.runApplet(attributes, parameters);
</script>
<script>
function print() {
var qz = document.getElementById('qz');
qz.append('A37,503,0,1,2,3,N,PRINTED USING QZ-PRINT\n');
// ZPLII
// qz.append('^XA^FO50,50^ADN,36,20^FDPRINTED USING QZ-PRINT^FS^XZ');
qz.print();
}
</script>
Does anyone have a basic code set that runs as a JNLP to work with newer versions of chrome and java???