Not printing EPL and ZPL format Labels

493 views
Skip to first unread message

Venkateswaramma Malluru

unread,
Jun 5, 2015, 7:24:43 AM6/5/15
to Tres.Fin...@gmail.com, qz-p...@googlegroups.com

Hello,

 

We are using QZ-Print software for labels, barcodes and documents printing with GT820 Zebra printer. With this we are able to print documents successfully but when tried to print the ZPL and EPL format labels getting exceptions in the applet class as below

 

java.lang.NullPointerException
        at qz. ImageWrapper.generateBlackPixels(ImageWrapper.java:219)
        at qz. ImageWrapper.init(ImageWrapper.java:387)
        at qz. ImageWrapper.<init>(ImageWrapper.java:57)
        at qz. PrintApplet.startJavaScriptListener(PrintApplet.java:204)
        at qz. PrintApplet.mav$startJavaScriptListener(PrintApplet.java:51)
        at qz. PrintApplet$1.run(PrintApplet.java:134)
        at java.security.AccessController.doPrivileged(Native Method)
        at qz.
PrintApplet.run(PrintApplet.java:129)
        at java.lang.Thread.run(Unknown Source)
Successfully called JavaScript function
    setTimeout(doneAppending(), 0)

 

The above exception is coming at the below code in applet class

 

 bi = ImageIO.read(new URL(file));


Please help me in resolving this issue

 

If there is any pricing for support please send us the details.

 

 

Thanks,

Eshwari

Tres Finocchiaro

unread,
Jun 5, 2015, 8:17:42 AM6/5/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
@Eshwari,

Are you trying to append an image?  The sample.html has logic for appending an image but if you're not using it, qz.appendImage() and qzDoneAppending() can be commented out.

Does the sample.html work without modification?  If so, it is likely that you need to remove the appendImage logic.

P.S. Commercial support is available here: http://buy.qz.io, but I'd like you to be happy with the product first.

Venkateswaramma Malluru

unread,
Jun 5, 2015, 8:40:23 AM6/5/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hello Tres,

 

We want to print the labels that are received from carriers like fedex and ups. Tried by removing qz.appendImage() and qzDoneAppending() but no luck. I am a bit confused here why to append the image and or not. Can you please explain this.  Using below code in javascript to print the label

 

       qz.appendImage(filePath, 'EPL', 150, 300);   //  Here filepath is the exact path of the lable sent by carrier

       

      window['doneAppending'] = function() {

          qz.append('\nP1,1\n');

     

          qz.print();

           

         window['doneAppending'] = null;       

 

       };

 

Will look at the pricing details also and get back to you. Can we get any contact number

 

Thanks,

Eshwari

Tres Finocchiaro

unread,
Jun 5, 2015, 9:52:37 AM6/5/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
Ok, if you need the images, then leave that in there.  Java doesn't understand relative paths, so your `filePath` may actually be the culprit there.

Can we get any contact number

I'll respond in a separate email.

-Tres

Venkateswaramma Malluru

unread,
Jun 5, 2015, 12:00:50 PM6/5/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Thanks for the reply. We are giving absolute path and not using any images. Directly we want to print the labels which are saved in a file and these labels come from carriers. Please send us the contact number.

Tres Finocchiaro

unread,
Jun 5, 2015, 12:25:42 PM6/5/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
 
Thanks for the reply. We are giving absolute path and not using any images. Directly we want to print the labels which are saved in a file and these labels come from carriers. Please send us the contact number.
 


Ok, that makes much more sense.  Try this please:

  qz.appendFile(filePath);
       
  function qzDoneAppending() {  
          qz.print();
  }
 

Venkateswaramma Malluru

unread,
Jun 8, 2015, 10:09:21 AM6/8/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Changing appendImage() to appendFile() worked.

 

We have purchased license and when we login with the key, found 2 different softwares - 1 with the name QZ Tray and the other as QZ Print. Could you please explain the difference between these 2.

 

Earlier we have downloaded the free version. Is this different from the licensed code.

Tres Finocchiaro

unread,
Jun 8, 2015, 11:20:06 AM6/8/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
@Eshwari,

QZ Tray is the successor to QZ Print.  If you are using the Java Applet, you will want to use QZ Print.

QZ Tray is a desktop application that will survive the removal of NPAPI from Chrome.  99% of the JavaScript code is the same and we will help you switch if and when you are ready.

> Earlier we have downloaded the free version. Is this different from the licensed code.

The code you've written is still good, but you will want to replace the libraries with the licensed version to remove the Java warning dialogs.

If you are using QZ Tray, then there is no longer any licensed code.  QZ Tray is free, we only require a valid certificate for silent printing.

If that is confusing or any part of that doesn't make sense, let me know.

-Tres 

Venkateswaramma Malluru

unread,
Jun 10, 2015, 6:49:04 AM6/10/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Thanks from the details. We have couple of questions more as below

 

Can this QZ Print software be used for Reading weights from Weighing scale.

 

Is there a version with applet that work with removal of NPAPI from chrome?

Tres Finocchiaro

unread,
Jun 10, 2015, 8:50:46 AM6/10/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
Can this QZ Print software be used for Reading weights from Weighing scale.

Yes specificially Mettler Toledo scales via the serial port functionality.  This requires the scale connected to a serial port (or a USB serial adapter).  We do not support USB scales at this time.

The Open Port and Send buttons in sample.html are already configured to work with a Mettler Toledo scale using the MT protocol.  Other protocols will likely works but would require some adjustments to the JavaScript code in the sample.html page.
 
 
Is there a version with applet that work with removal of NPAPI from chrome?

Yes, QZ Tray

Downloadable here:  https://qz.io/download 

Usage here:  https://qz.io/qztray

Venkateswaramma Malluru

unread,
Jun 10, 2015, 9:21:39 AM6/10/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Can we get code for USB supported weighing scales in future. If so how much time do we need to wait for this.

 

Already we are using QZ Print for printing. To make the applet working with removal of NPAPI from chrome what changes do we need to do in the existing code.

Tres Finocchiaro

unread,
Jun 10, 2015, 10:42:20 AM6/10/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com

> Can we get code for USB supported weighing scales in future. If so how much time do we need to wait for this.

Java doesn't offer HID support, which is required for true USB support, so the likeliness of this is under investigation.

If you are using a MT scale with a serial port, we have constructed special USB cables to make them plug in, but still use serial support.  Please inquire if interested.

> Already we are using QZ Print for printing. To make the applet working with removal of NPAPI from chrome what changes do we need to do in the existing code.

You'll need to add a two new functions, signRequest() and getCertificate() and include qz-websockets.js.  This can be observed in sample.html, distributed with our qztray software.

In regards to running both, we have a fallback process so that you can continue using the applet, but FYI, there is currently a bug which prevents non-qz-tray users to fallback on the applet when using HTTPS (should be fixed this week).

Venkateswaramma Malluru

unread,
Jun 11, 2015, 9:15:19 AM6/11/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Downloaded the QZ-Print-1.9 version with the key you provided after purchasing the license. And now when tried to open the sample.html file present in the demo folder getting the error message as shown in the below screenshot. How to resolve this error

 

 

Thanks,

Eshwari

 

From: Tres Finocchiaro [mailto:tres.fin...@gmail.com]

Sent: Wednesday, June 10, 2015 8:12 PM
To: Venkateswaramma Malluru
Cc: qz-p...@googlegroups.com

Tres Finocchiaro

unread,
Jun 11, 2015, 9:42:51 AM6/11/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
@Eshwari,

Yes, we've found an issue with IE per:  https://github.com/qzind/qz-print/issues/39

We'll be releasing 1.9.1 this week (tentatively) to address this as well as a few other issues, but you can use this installer temporarily if you'd like:



Note, IE must be restarted after install for this to work properly.

Tres Finocchiaro

unread,
Jun 11, 2015, 9:44:02 AM6/11/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
Actually, that is a separate issue... Are you running Java 7 or Java 8?  That is now required for QZ Tray.  Java 6 won't work any longer due to the Jetty requirement for WebSockets.

Venkateswaramma Malluru

unread,
Jun 11, 2015, 12:53:34 PM6/11/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Tres,

We are using java 6 and can't upgrade to higher version. Please suggest us what to do further.

Thanks ,
Eshwari

Tres Finocchiaro

unread,
Jun 11, 2015, 12:54:50 PM6/11/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
@Eshwari,

We have no plans to support Java 6 for QZ Tray.  If you require Java 6 support, you will need to use the Java Applet version, which we still support for Java 6, 7 and 8.

-Tres

Venkateswaramma Malluru

unread,
Jun 11, 2015, 12:57:42 PM6/11/15
to Tres Finocchiaro, qz-p...@googlegroups.com

We tried to open the sample.HTML of QZ-print only and got the below error.

Thanks,
Eshwari

Tres Finocchiaro

unread,
Jun 11, 2015, 2:18:47 PM6/11/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
@Eshwari,

You'll want to use the <applet> version here:


Sorry, our downloads page is down temporarily.

-Tres

Venkateswaramma Malluru

unread,
Jun 12, 2015, 3:34:06 AM6/12/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Downloaded the applet version from the link below and got the below error when tried to open sample.html

Tres Finocchiaro

unread,
Jun 12, 2015, 9:41:56 AM6/12/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
@Eshwari,

This can take some time to setup.  Here is our tutorial.


-Tres

Venkateswaramma Malluru

unread,
Jun 17, 2015, 10:19:19 AM6/17/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Have 1 question on the location of the file that has to be printed. Do we need to have the file available in the client machine locally or can we also use the file that is located in the server for printing. Could you please help us in getting printed the file that is saved in server with the printer set up in the client machine.

Tres Finocchiaro

unread,
Jun 17, 2015, 10:33:23 AM6/17/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
 Do we need to have the file available in the client machine locally or can we also use the file that is located in the server for printing.

The software is designed to get it from the server.

Could you please help us in getting printed the file that is saved in server with the printer set up in the client machine.

Sure.  Can you send some information about how you get the file today?

Generally, this is the approach:

qz.appendFile("http://myserver/myfile"); 
 
function qzDoneAppending() {
   qz.print();
}

Although most clients serve the file up using a server-side technology, such as PHP:


qz.appendFile("http://myserver/raw.php?someparam1=somevalue&someparam2=somevalue"); 
 
function qzDoneAppending() {
   qz.print();
}

Venkateswaramma Malluru

unread,
Jun 17, 2015, 10:40:41 AM6/17/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

We are saving the files in UNIX file system through our web application and the path to the file from root path will be as below

 

/user/tomcat/labels/file

Tres Finocchiaro

unread,
Jun 17, 2015, 11:35:23 AM6/17/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
Thanks.  In that case, you should be able to do:

qz.appendFile("http://myserver.com/user/tomcat/labels/file");

The full path is needed, sicne Java is unaware of the URL of your web page.  You can infer the URL by using something like "window.location.href" or "window.location.pathname"

-Tres

Venkateswaramma Malluru

unread,
Jun 18, 2015, 11:27:55 AM6/18/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Tried as suggested you by giving  qz.appendFile("http://sharp.appsahyd.com/home/aasc/aasc/labels/1Z3749X40294659324"). But this didn't work.

 

This file is outside tomcat folder.

Tres Finocchiaro

unread,
Jun 18, 2015, 12:09:55 PM6/18/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com

Does the page require authentication?  Can you disable authentication as a troubleshooting measure?

Venkateswaramma Malluru

unread,
Jun 18, 2015, 12:18:05 PM6/18/15
to Tres Finocchiaro, qz-p...@googlegroups.com

No, authentication is not required.

Thanks,
Eshwari

Tres Finocchiaro

unread,
Jun 18, 2015, 12:19:54 PM6/18/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com

The file you have referenced won't load  for me.  Can you supply a publicly accessible version?

Venkateswaramma Malluru

unread,
Jun 18, 2015, 12:35:51 PM6/18/15
to Tres Finocchiaro, qz-p...@googlegroups.com

The file I want to print stores in unix server in which tomcat is also placed. The application we use is deployed in the tomcat container. File is outside tomcat folder.

Thanks,
Eshwari

Tres Finocchiaro

unread,
Jun 18, 2015, 10:14:17 PM6/18/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
The file I want to print stores in unix server in which tomcat is also placed. The application we use is deployed in the tomcat container. File is outside tomcat folder.

If Java can see it, it should work.  Can you post the output from the Java console (must be enabled first via Configure Java)?  Also, if you are a premium subscriber, we can talk directly though sup...@qz.io.

-Tres

Venkateswaramma Malluru

unread,
Jun 19, 2015, 3:51:48 AM6/19/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Here is the output of the console when I used qz.appendFile("http://sharp.appsahyd.com/home/aasc/aasc/labels/1Z3749X40294659324")

 

url in readRawFile : file:/C:/Users/venkateswaramma.mall/Desktop/http:/sharp.appsahyd.com/home/aasc/aasc/labels/1Z3749X40294659324

java.io.FileNotFoundException: C:\Users\venkateswaramma.mall\Desktop\http:\sharp.appsahyd.com\home\aasc\aasc\labels\1Z3749X40294659324 (The filename, directory name, or volume label syntax is incorrect)

                at java.io.FileInputStream.open(Native Method)

                at java.io.FileInputStream.<init>(Unknown Source)

                at java.io.FileInputStream.<init>(Unknown Source)

                at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)

                at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)

                at java.net.URL.openStream(Unknown Source)

                at qz. FileUtilities.readRawFile(FileUtilities.java:73)

                at qz. PrinterApplet.startJavaScriptListener(PrinterApplet.java:172)

                at qz. PrinterApplet.mav$startJavaScriptListener(PrinterApplet.java:51)

                at qz. PrinterApplet$1.run(PrinterApplet.java:134)

                at java.security.AccessController.doPrivileged(Native Method)

                at printer.AascPrinterApplet.run(AascPrinterApplet.java:129)

                at java.lang.Thread.run(Unknown Source)

 

Few more questions

·         I am setting the number of copies as qz. .setCopies(1); but printing 2 copies of same file.

·         When trying to print 2 files one by one on a single button click, first file is not printing whereas second file is printing. If I try to print only first file, it printed successfully. How to print more than 1 file in one cycle on 1 button click

 

Thanks,

Eshwari

 

From: Tres Finocchiaro [mailto:tres.fin...@gmail.com]
Sent: Friday, June 19, 2015 7:44 AM
To: Venkateswaramma Malluru
Cc: qz-p...@googlegroups.com
Subject: Re: Not printing EPL and ZPL format Labels

 

The file I want to print stores in unix server in which tomcat is also placed. The application we use is deployed in the tomcat container. File is outside tomcat folder.

Tres Finocchiaro

unread,
Jun 19, 2015, 9:01:47 AM6/19/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com

Hmm... Something is wrong as it is trying to grab the file using a relative path.

Sorry if you have already specified, but are you using 1.9.2?  The QZ Tray desktop version or the QZ Print applet version?

Venkateswaramma Malluru

unread,
Jun 23, 2015, 5:41:19 AM6/23/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

We have downloaded 1.9.2 QZPrint applet version, but there is no source code in the downloaded file. So still using the freeware code.

 

We are using qz.appenPrint(path)   ---> Here path is a substring of  window.location.href concatenated with the actual label path in the server

 

Now we are getting the path as below in the java console when we try to print the label

 

java.io.FileNotFoundException: http://sharp.appsahyd.com:8080/home/aasc/aasc/labels/1Z3749X40294659324

                at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

                at java.net.URL.openStream(Unknown Source)

                at printer.FileUtilities.readRawFile(FileUtilities.java:73)

                at printer.PrinterApplet.startJavaScriptListener(PrinterApplet.java:171)

                at printer.PrinterApplet.mav$startJavaScriptListener(PrinterApplet.java:51)

                at printer. PrinterApplet$1.run(PrinterApplet.java:134)

                at java.security.AccessController.doPrivileged(Native Method)

                at printer. PrinterApplet.run(PrinterApplet.java:129)

                at java.lang.Thread.run(Un

 

our folder structure in UNIX is as below

 

/home/aasc/aasc/tomcat  --> path from root where tomcat is placed

/home/aasc/aasc/labels/  --> is the path where labels are saving in the server

 

Please let us know how to get access to the files saved in labels folder that are placed outside the tomcat in the server. We have to resolve this at high priority.

 

 

 

Thanks,

Eshwari

 

From: Tres Finocchiaro [mailto:tres.fin...@gmail.com]

Sent: Friday, June 19, 2015 6:32 PM
To: Venkateswaramma Malluru
Cc: qz-p...@googlegroups.com

Tres Finocchiaro

unread,
Jun 23, 2015, 1:22:24 PM6/23/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
Please let us know how to get access to the files saved in labels folder that are placed outside the tomcat in the server. We have to resolve this at high priority.

I'm sorry if this comes off as dismissive, but how can anyone help you get files off of your server that aren't hosted in tomcat?

One way would be to make a server-page that reads and echos the contents of the file, but that is quite outside the scope of a print plugin and more about accessing files outside of a webroot, which would be a similar technique used for all web servers and all server-side programming languages.

-Tres 

Venkateswaramma Malluru

unread,
Jun 26, 2015, 5:11:59 AM6/26/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

We have a requirement of printing more than 1 document on click of button. For this we are looping the print request calling. Here all the requests are going properly but only the last document sent in the request to printer is printing.

 

How to print the multiple labels at a time.

Tres Finocchiaro

unread,
Jun 26, 2015, 8:22:41 AM6/26/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
Do you wish to print after they have all been appended, or in between each?

When appendFile() is called, you must wait for qzDoneAppending to be fired.  If you are doing this multiple times in a row, we generally suggest making qzDoneAppending a stand-alone function and storing the label number in a variable.

If you are calling print, you will need to use the same counter method for qzDonePrinting.  This is because appendFile() and print() are both asyncronous functions and you will hit a race condition if you do not wait for qzDoneAppending and qzDonePrinting to be called inbetween iterations.

-Tres

Venkateswaramma Malluru

unread,
Jun 26, 2015, 8:36:55 AM6/26/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

In anyway, but the requirement is to print all the labels (either ZPL or EPL) and the documents(pdf) that are passed to the printer at 1 point of time(I mean on single click of a button).

 

We are using appendFile() for ZPL , EPL and appendPDF() for pdf.

 

How to use counter method for calling appendfile() and print() methods synchronously.

Tres Finocchiaro

unread,
Jun 26, 2015, 9:08:54 AM6/26/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
This is the approach I would take:

var counter = -1; 
 
var files = ["raw1.txt", "raw2.txt", "raw3.txt"]; 
 
function appendFiles() {
// Manually fire the done appending function
qzDoneAppending();
}
 
 
function qzDoneAppending() {
if (++counter < files.length) {
qz.appendFile(getPath() + files[counter]);  // getPath() helps resolve URL
} else {
qz.print();
}
}

Venkateswaramma Malluru

unread,
Jul 1, 2015, 12:54:16 PM7/1/15
to Tres Finocchiaro, qz-p...@googlegroups.com

Hi Tres,

 

Thanks for help out printing multiple files at a time. Now we are able to print multiple files at a time.

 

Can we print multiple copies of same file at a time.

 

Now we are saving labels inside Tomcat and the path is   TOMCAT_HOME/labels/  and when tried to print using location.href  getting Exception as below

 

file : http://172.16.0.13:8080/labels/794642734816

 

Exception: java.io.FileNotFoundException: http://172.16.0.13:8080/labels/794642734816

 

 

Tried placing labels inside webapps and outside webapps folder of the Tomcat.  Please let us know how to print the files that are saved inside tomcat on the server.

Tres Finocchiaro

unread,
Jul 1, 2015, 1:00:58 PM7/1/15
to Venkateswaramma Malluru, qz-p...@googlegroups.com
Can we print multiple copies of same file at a time.

We haven't added the copies feature to our raw code yet, however most raw languages allow multiple copies per parameter.  If using EPL, the command is P1,5 (I believe, which would print 5 copies of each label).

tried placing labels inside webapps and outside webapps folder of the Tomcat.  Please let us know how to print the files that are saved inside tomcat on the server.

Can you access this page directly with a different web browser?   That is the best way to test it.

-Tres
Reply all
Reply to author
Forward
0 new messages