0

We are having a problem getting a print job to print using a print server and print queue. The print job shows in the print queue with a status of spooling, but does not print. When stepping through the program line by line, the job shows up in the queue after the PrintSystemJobInfo job = pq.AddJob() line and it stays in the print queue showing it is spooling. The job never prints. Continuing to step through the code the job disappears after the write.Close() line. The print log shared with us by one of the network administrators verifies the job is added to the queue and is deleted without printing.

Below is a stripped down version of the code we are using for the print job. The actual print job contains a lot of ZPL commands including formatting of text. The code below is, based on other posts we've found, should be a simple way to print a print job using a print queue on a print server. This stripped down code and the actual print job with the ZPL commands behave the same meaning that the job gets to the queue, is showing as spooling, but does not print and is deleted after the Close line.

PrintServer ps = new PrintServer(@"\\10.10.15.158"); //example of a print server ip
PrintQueue pq = ps.GetPrintQueue(@"Printer1"); //example name of printer 
PrintSystemJobInfo job = pq.AddJob();
StreamWriter writer = new StreamWriter(job.JobStream);
writer.Write(@"Test label<p>");
writer.Flush();
writer.Close();

The printer works properly for other programs that print to it so we know it is not the printer that is the issue. None of us have much experience using ZPL to print directly to a printer, but we do have a couple programs that print labels properly using ZPL code when sent to a printer IP without using a print server or print queue. This program requires using a print server and queue because we cannot have the labels not printing because the printer is out of ribbon or labels. We have searched for answers and tried different options found on a couple sites, but so far nothing has been able to help us resolve the issue. Any assistance would be greatly appreciated.

Also, I just created an account for this site and this is my first question post so I apologize in advance if this post is not properly set up. Any advice to clean up this post and that can be used in future posts would be happily accepted.

  • A couple of things you can check: what happens if you send the same ZPL code directly to the printer? you can save it into a text file and push it through the driver. Second thing is, does the data led blinks when you send the label to the printer? – ZRep Nov 30 '22 at 18:04
  • Thanks for the response. ZPL code sent directly to the printer works close to 100% of the time. It is rare, but occasionally one of the labels does not print and there is no error received. We are hoping that using the print queue will eliminate the issue with the label not printing. When printing a Windows test print, the LED light blinks and the label prints. When ZPL is sent directly to the printer, the label prints and the LED does not blink. When sending the label through the queue the label does not print (stays spooling until the write.Close() line) and the LED does not blink. – Oliver Yoliver Dec 01 '22 at 14:22
  • What printer model are you using? – ZRep Dec 01 '22 at 16:36
  • All of the printers we are sending the print jobs to are the Zebra GX430T model. – Oliver Yoliver Dec 01 '22 at 17:43
  • I asked about the model because the linkos printers (which the GX430 is not), support the input capture command (http://www.thezcorner.com/doku.php?id=language:retrieve_code#inputcapture_command) which allows you log the code the printer receives and this would be useful to troubleshoot this issue. – ZRep Dec 02 '22 at 14:03
  • 1
    While I still would like to try to get the printing working using the original set up that I posted in the question, I was able to get the print queue working as mentioned in your initial response; "save it into a text file and push it through the driver". Once I modified the code to use this method, testing has been flawless so this is an acceptable solution. I appreciate you taking time to respond and helping me find a way to get this issue resolved. – Oliver Yoliver Dec 06 '22 at 13:29

0 Answers0