Dynamic Job Routing: Using Data from the Print Job

Tue, 07/26/2016 - 16:39 By Dave Brooks

We recently introduced dynamic job routing for RPM Remote Print Manager® (RPM). Dynamic job routing uses actual data values to process your print jobs.

How to use job data

RPM relies on the LPD protocol to provide data about the print job, as well as the actual print job itself. We use those values in diverse ways such as an archive file name, an email address or subject line, arguments to local programs and more.

Here’s an example. One of the attributes LPD provides about the print job is the user who printed it. Let’s say some of the print users in your network are Ethan, Noah, and Lucas. (These are 3 popular male names in the US in 2016). We'll see that RPM can use the print username to direct print jobs into a queue named with that value.

The essence of dynamic job routing is that we first construct a queue name using one or more print job values, then redirect the job to that queue.

Our first example will be setting up a workflow based on the print user value. We will end up with print queues called "print-ethan", "print-noah", and "print-lucas".

How to set up a print user workflow

Let's construct a workflow that uses the print user associated with the print job. As we mentioned above, the print username is already provided to us and we don't have to do anything to retrieve it; we just use it.

We will outline the steps below.

  1. Create a queue. We’ll call it “print”
  2. Add a Copy to Queue action to this queue.
  3. In the action setup, select “Dynamic Queue”. This is only available in the Elite version of RPM.
  4. Open the Variables drop list. Next, click the “+” next to “Job Attributes”. Now select “User” from the list.
  5. In the Template field type “print-” without the quotes
  6. Click the “Insert” button. The mask should now read “print-<P>”. For me, the example reads “print-Dave”.
  7. Select “Create queues that do not exist” (note that we'll talk about caveats later)
  8. Click OK to close the “Copy to Queue” dialog, then click OK to close the “Configure queue” window.

Now we have a queue that will redirect jobs based on the user that printed the job. I also created on my computer 3 queues named "print-ethan", "print-lucas", and "print-noah". One queue prints to the LaserJet in the hall outside my office; another queue converts to PDF and archives. You can do anything you want. With this setup when you add a user you would:

  • print to RPM
  • open the RPM user interface and track down the new queues
  • set up the queue to do whatever is right for that user.

It’s that simple! RPM will create the queue and store jobs there until you have a setup.

How to add custom signatures to invoices

Let’s take a look now at how we could customize print jobs using data we extract from the job itself. RPM has another new capability called data extraction. Data extraction will pull any text data and make it available for processing. This way we can add a watermark based on a value in the print job itself.

Many of our customers print invoices. We prepared dummy invoice samples which include a “REP” field. Here are lines 16 and 17 from one sample:

  AUTH-CODE       PO#            REP       SHIP VIA       TERMS       DUE DATE
  1234-wxyz       NC469618       RS3883    Downloaded     Net 30      3/31/2016

The rep in this sample is “RS3883”. We will see how to use that information to our advantage.

First, let’s extract the rep field using the Data Extraction transform. We described on the data extraction page how to do that so we won’t go through all the steps here. It is a simple exercise to go to line 17, column 34 and extract 6 characters. If not, please review the data extraction page.

Let’s assign our rep to the job attribute called Banner since it’s not commonly used.

One thing to be aware of about our sample invoices is that they are 60 line, 80 column text files. There should be enough blank space at the bottom of the page for a signature block. But, at some future point, there may not be room and the signature could overwrite part of the actual invoice. That's why I'm going to process the invoices as if there were supposed to be 72 lines, which should leave enough room for the signature and a company logo. If not, it would be easy to adjust until it fits. There is nothing magic about 72; it's just a guess. Again, this is just an example, not a finished product, so your results may vary.

The steps to create this setup:

  1. We will create a queue called “invoices”
  2. Add a Data Extraction transform to pull out the rep field and put it in Banner
  3. Add a Text to Text Markup transform, and rather than use best-fit, let’s set 72 lines per page and 80 columns per line
  4. Add a Text Markup to PDF transform
  5. Add a Copy to Queue action. Send the jobs to “sig-” and add the Banner variable. The result should look like “sig-<L>”

Before we create a queue for rep RS3883, we need to do one more thing. RPM includes an image overlay manager. We will need an image file we can use as a PDF Watermark for each rep. Add these to the image overlay manager. I envisioned them at the bottom right of each page but that’s for demonstration purposes only.

We will also create a queue “Archive-rep” which will store our PDFs in a folder. Or you can do whatever makes sense in your environment. Again, this is for demonstration purposes only.

Finally, we’ll create the queue for our rep.

  1. Create queue “sig-rs3883”
  2. Add a Watermark PDF transform, and select the signature file for this rep
  3. Add a “Copy to queue” action and send the job to “Archive-rep”

Tips to improve workflow

You may ask, why create another queue? Why not just put the archive action in the rep signature queues?

The answer is it pays dividends to plan your workflow by asking, what parts are different for each "type" and what parts are the same? The "different" parts are the rep signature. The "same" parts are adding a company logo and what we do with the result, in this case, "archive to folder".

You know that in 3 months there's going to be a system change and you'll be doing something else! Maybe you'll want to run a program to submit it to the document storage or send it via email. So, put the "same" element in one place and make it easy on yourself.

This is also the reason I did not suggest putting the company logo watermark with the rep signature. You know that's going to change at some point as well when someone improves it "just a little bit". Again, having an identical operation repeated many times is not a time saver, it's an opportunity to hunt down and fix things.

Tips for easier configuration

Now we will create more queues for the other reps. This is an opportunity to highlight a feature of the RPM user interface. Open two “configure queue” windows at once, then drag transforms and actions from one to the other.

Having used the RPM UI a fair bit, I would do this:

  • open the sig-rs3883 queue (our first one)
  • create another queue, and just drag the transform and action over to the new queue. When you drag you are copying, not moving.

Be sure to change the “Watermark PDF” transform in each new queue to use the correct signature, not the one for rep RS3883.

Final thoughts

I assumed for this example that we would create a PDF and archive it. With a bit more work we could extract an email address and email the PDF as an attachment. We could also print the invoice with the watermarks to a local printer.

If you see a potential for solving some of your print problems here, please contact us! We love to brainstorm about these things.