Print problems: dealing with bad PCL

Not long ago we were able to help a partner company with a printing issue. This company uses a system that generates custom PCL, the language for HP printers used worldwide. We are not familiar with their system, but we help them with various printing issues. In turn, they provide many of their customers with our RPM Remote Print ManagerĀ® (RPM) software.

In this post, we'll describe the problem, and follow up with two approaches to solve the problem.

The problem

The issue that came up was something like this: they have a 26-page document, but only the first 25 pages print. What to do?

We looked at the PCL but didn't see an obvious problem. Then we used a script to copy the PCL to one of our printers. This script would monitor the printer for responses, as well as sending the data to the printer. It turns out the printer was sending back a message about "illegal media source error" which, in this case, meant the job was trying to load paper from a tray the printer didn't have.

For various reasons, the technician we spoke to was not able to change the upstream process that created the PCL, which is why they contacted us.

First problem-solving approach: fix the PCL

At this point, we were able to solve their problem by using RPM's PCL Resource Mapping transform to fix the problem in their PCL input. The setup form for the PCL Resource Mapping transform appears below. :

Using the PCL Resource Mapping transform to select input

Note the top of the form with the yellow highlight. You can map any input tray in the file to a specific tray or one specific tray to another.

The question is, how do you know which tray to use? It would be easy if the PCL code accurately matched your printer user manual, so "tray 1" in the PCL file is the same "tray 1" we expect.

Sadly, it doesn't work that way. RPM includes an option to "Log detected trays and bins." Please note the form above. I've highlighted this selection near the bottom of the form.

PCL uses numeric codes for trays and bins rather than a description. When you are working on this setup and need to know what the PCL file specifies, turn on the logging option and run one or more error-free jobs. The log should give you all the information you need to select trays and bins.

Once you generate the "fixed" PCL file, you will continue to print in RPM the way you have been. There are three distinct ways to print this type of data in RPM:

The advantage of this approach is that it uses the fewest possible steps. The disadvantage is that you have to investigate the numeric ID of the tray you want to use, and that may take a few minutes. Also, it may be a different result for a different printer.

Second problem-solving approach: generate PDF and print

A second approach is to use RPM's built-in PCL to PDF function. If you generate a PDF from your problematic PCL file, you'll eliminate tray and bin errors because PDF doesn't contain that information.

Converting PCL to PDF is a standard function in RPM. We have a lot of content about that already.

Once you have generated your PDF file, this page will walk you through the steps to print the PDF to the Windows printer of your choice.

The advantage of this approach is that when you create a PDF, you probably eliminate all of your worries since PDF is a problem-free media that is well understood. The disadvantage would be that it is a few more steps to prepare the command line for printing the PDF.

Please let us know in the comments what you think of this article and if you have printing problems, you would like for us to address in the future.