Web LPD/IPP Printing Service for IBM i

This blog post is a quick introduction into new printing features incoming into next Green Screens Server 2022.Q3 Release. Learn the basics how to send spool files through an IBM i LPD / IPP printer to a web browser, including new direct web print feature.

Until now, Green Screens Server required each workstation user to start its own web printer session to be able to receive released spool files into the browser.

With new features, it is now possible to simplify and automate this process even more with the help of LPD/IPP printing support.  Now, system admins can create printer writers / remote OUTQs and map them to a USER/DISPLAY to automatically redirect a released spool to a proper web terminal, either for a preview or direct web print without user intervention.

With this feature, workstation operators can forget about printer sessions.

IBM i printing supports multiple standard printing protocols such as IPP, PJL, SNMP, LPD etc. LPD is the simplest amongst all of them, basic one but that is all what we need as Green Screens Server handles the rest.

Green Screens Printing Service for Web is a modern version of old classical LPD printer enabled to send spool files to a web based terminal session - to the browser. When IBM i is configured to print to the standard LPR/LPD daemon, spools can be selectively sent to the Green Screens server, being processed into a PDF and opened at the targeted user without need for a user to start a printer session.

The same new printing module also supports an IPP printing protocol with support for API Key and HTTPS security, allowing to safely print spool files directly to the Green Screens Servers located on the public network.

Load balancing support

In large and more complex environments, companies wants to use a Green Screens Server not only behind the proxy, but also wants to use a load balancer to spread the load between multiple Green Screens Servers, or simply, wants to have a redundancy if one of the Green Screens servers is down.

If there are 2 or more Green Screens Servers and front proxy decide to which server a specific user will be redirected, we can't possibly know on which Green Screens Server instance a specific user / workstation will be activated. Thus, creating remote print from IBM i might become complex to handle.

To overcome the problem, we created a Printer Splitter Proxy module, a small standalone MS Windows and Linux based program which in essence is an LPD service and an LPD client in the same time. Received spool files will be reprinted (resubmitted) to all Green Screens servers listed in the LPD Splitter configuration file.

Spool acceptance - or spool selection is based on a specific OUTQ format in the form  of UUID/HOST/WRITER/USER*/DISPLAY*, that allows targeting a specific terminal user or station. If the user is connected to a Green Screens Server 1, only that server will accept the spool. Other Green Screens Server instances will silently reject printing request.

The process itself  is fully transparent to the IBM server, and LPD Splitter. IBM i will simply do a standard remote LPD print to an LPD Splitter without worrying about what's behind.

To print to the Green Screens Server LPD daemon, simply use OUTQ targeting remote system as shown in example below. And, that's it.

As one can see, remote OUTQ name has a URL style format including query parameters which are actually printer attributes such as driver type, drawer size, code page etc... This allows you to create multiple different OUTQs to print the same spool file in different formats. For example, in PDF, HTML or one of image supported formats.

CRTOUTQ OUTQ(PRT_LPD) RMTSYS(INTNETADR)
RMTPRTQ('UUID/HOST/OUTQ/USER*?/DISPLAY*?codePage=850&driver=1')
AUTOSTRWTR (1) CNNTYPE (*IP) DESTTYPE (*OTHER)
TRANSFORM(*NO) INTNETADR('192.168.1.111') DESTOPT ('XAIX')

Cloud Print

Implemented IPP (Internet Printing Protocol) feature into new "service.printing" module allows safely sending spool files through HTTP/s to a Green Screens Server located in cloud environment out of local company network.

If multiple Green Screens Server are used, Printer Splitter Proxy can print to multiple Greens Screens IPP service using HTTP/s protocol also.

Principle is the same as with LPD printing, except target services URL's will be IPP://....

As Green Screens Server acts as a security layer between end users (being in the internal network or Internet), having it installed in the cloud would require IBM i to have access to the Internet, which is not always what is allowed. However,  printing directly from IBM I server to the Green Screens Server in such case might be an issue, so the Printer Splitter Proxy comes in very handy to be a bridge between the two.

Printer Splitter Proxy (PSP)can be located in internal network in DMZ, IBM i servers in internal network will print to PSP, which will forward spools to targeted Green Screens Server ins the cloud.

Cloud Print Security

When Green Screens Server located in cloud environment, IPP protocol is exposed to the public access. To protect printing service, we also added  integration with API Key feature already available in Green Screens Server.

The API Key is linked to a specific host configuration and incoming IP address to control access to the IPP Service. To secure Internet printing, only what is required is to add an API Key to an IPP URL.

Printing integration

Some companies are using external products to generate PDF from spool files on a mass scale with additional processing. Our IPP module can be used to print generated spool files to a user web terminal workstation. The PDF document will be opened by a targeted user web terminal session.

There are multiple ways to do that. With use of API Key protected spool forward print service, or IPP print service. For an example, external products if supports auto-print to CUPS/IPP, requires only a Green Screens Server IPP URL with OUTQ name in one of supported formats shown in next section.

Direct Web Print

Except "printing" a PDF document to a web workstation through implemented IPP printing service, other type of raw documents are supported such as PCL, SCS, ZPL, etc. New feature Direct Web Print is a new module of web-to-desktop integration which allows browser to automatically print one of received raw documents directly to the predefined printer.

IPP Examples

The Green Screens IPP print service is based on URL. Various formats are supported to support different IPP clients.

The most basic one is OUTQ name and API Key. Configuration data that link OUTQ to a user or display station is read from central configuration management available inside web admin console.

http://gsserver/service.printing/ipp/PRTDEMO1?key=ac1e11ef-c674-45fa-85ab-8b3c364edc7f

Alternatively, if no central management is used, provide printing parameters in a query string.

http://gsserver/service.printing/ipp/PRTDEMO1?key=ac1e11ef-c674-45fa-85ab-8b3c364edc7f&display=DSPDEMO001&drawer1=0&driver=0 

In MS Windows, one can even add a custom printer (which can be used for integration purposes). In such case, OS will escape query parameters as shown below. This format is also supported.

http://gsserver/service.printing/ipp/PRTDEMO1~3fkey~3dac1e11ef-c674-45fa-85ab-8b3c364edc7f~26display~3dDSPDEMO001~26drawer1~3d0~26driver~3d0

Some clients do not support more than 1 query parameter (official "ippsample" testing tool). The solution is to use Base64 encode to mask parameters.

Simply, encode OUTQ name and query parameters...

PRTDEMO1?key=ac1e11ef-c674-45fa-85ab-8b3c364edc7f&display=DSPDEMO001&drawer1=0&driver=0 

...then attach Base64 to an "outq" query parameter as shown below.

http://gsserver/service.printing/ipp/PRTDEMO1?outq=UFJUREVNTzE_a2V5PWFjMWUxMWVmLWM2NzQtNDVmYS04NWFiLThiM2MzNjRlZGM3ZiZkaXNwbGF5PURTUERFTU8wMDEmZHJhd2VyMT0wJmRyaXZlcj0w