Why the virtual PDF printer on i5/OS might fail
If you have 5722-IP1 installed on your System i, you can create PDF documents quite easily by using a virtual PDF printer.
This virtual PDF printer can be created by using the following two commands:
CRTPSFCFG PSFCFG(QUSRSYS/PRTPDF) PDFGEN(*STMF) +
PDFDEVTYPE(*IP40240) PDFPPRDWR1(*A4) PDFPPRDWR2(*A4) PDFMULT(*NO) +
PDFDTAQ(*NONE) FNTSUBMSG(*NO) IPDSPASTHR(*NO) PDFDIR('/PDF/')
CRTDEVPRT DEVD(PRTPDF) DEVCLS(*LAN) TYPE(*IPDS) MODEL(0) LANATTACH(*IP) AFP(*YES) +
PORT(5039) ONLINE(*YES) FONT(223) FORMFEED(*AUTOCUT) +
RMTLOCNAME('127.0.0.1') USRDFNOBJ(QUSRSYS/PRTPDF *PSFCFG)
In case you’re wondering what is running on Port 5039 on localhost – usually nothing. When you start the printer writer for this printer using STRPRTWTR, you’ll see three jobs for this printer instead of the usual two. One of them is the virtual PDF print server, which is spawned by the PSF configuration.
And this is exactly the problem i ran into: Port 5039 on localhost was already in use (in this case by a third party application), and so the virtual PDF print server was unable to start. Of course the only thing you saw in the logfiles was that the PRTPDF print writer was unable to connect to it’s print server, and not that the port was already in use.
Note that the virtual print server fetches it’s configuration from the device description, so if you change the port in the device description, everything will work automatically.

Leave a comment