What happens when you want to print a PDF from IBM i via a regular IBM i writer and output queue, where do you start with that? Let’s face it, there is no native PRTPDF (Print PDF) command in IBM i.
Well, this was the question I received the other day and I was delighted by how simple the solution was. There is no need for third party applications, open-source solutions or complex programming, just the simple us of a Printer File to convert the PDF to a Spool File, which then gets sent to a printer in the normal way.
In fact, you can even turn your IBM i server into a network PDF Direct Printer server, handling requests from pretty much any source at zero cost. I’ll explain how this hangs together and give you an example configuration but first a little background and context, feel free to skip the next bit if you know it, I won’t tell anyone I promise 😉
PDF (Portable Document Format) has become the de facto standard the IT industry has settled on for viewing and exchanging documents and this applies to IBM i just as much as any other platform. For over a decade we have been replacing physical printouts with PDFs.
Setting up Printers is a pain in the posterior
If you have ever installed a printer on a PC or Mac you will no doubt know that you need to get a piece of software called a “Printer Driver” that converts the thing you want to print, into a language that the specific printer understands.
There are literally thousands of different drivers and if you don’t get the right one then you end up with pages of waste paper covered in gibberish text that is indecipherable even to those as bright as the Bletchley Park Code Breakers!
What is PDF Direct Printing?
The way that many printer manufacturers are solving this is by letting you send a standard PDF file directly to the printer and letting the printer itself render the desired document image within the printer itself in real time as it prints the document. Thus, doing away with the need to have the Printer driver.
This is ideal for ERP servers whose raison d’etre is get on with processing the core business data, not to pander to a hundred different printer manufacturers each with plethora of different ways to encode a print.
Instead, the system encodes the output, including all of the desired fonts, graphics and formatting in a single format that everyone can use freely.
Now, not all printers out there today are PDF Direct enabled but it does seem to be becoming the norm, especially amongst the Thermal Label Printing manufacturers.
How to configure PDF Direct on IBM i
Well, if you have not configured a standard network printer device description for this printer already, then do so with a command along the lines of the following:
Pro tip: If your printer does not like the IBM SNMP protocol used in the above example, scroll down to the bottom of this article, where I have included a link to an IBM support article which gives you several other options.
Then create a Printer File that will send data to your printer device description, using a command along the lines of:
Vary on the Device Description and start the writer as you normally would.
To print a PDF simply copy the PDF file to the Printer File, this will in turn create a spool file native containing the PDF data, which the PDF Direct enabled printer will ingest, render and print.
One of the easiest ways to copy the PDF to the printer file is to use FTP, this method has the added benefit of not only allowing you to print a PDF from the local IBM i system but also from any other remote system regardless of whether they are IBM i or not.
If FTP is not your thing, then feel to pick another way to copy the contents of your PDF to the Printer File, I’m sure there are many ways, each with their own merits. Feel free to add your preferred method to the comments below. IBM has created a useful Support Document on this subject, that gives you more options and information that you may find useful.
i-UG goes Hybrid
We are returning to the Mount Hotel in my home town of Wolverhampton for another Hybrid event on the 6th & 7th July, we hope to see you there.
For more details check out www.i-ug.co.uk