|What You Need to Know to Convert Spooled Files to PDF (and More)!|
|Application Software - Document Management|
|Written by Steve Pitcher|
|Wednesday, 13 July 2011 00:00|
The changes in 7.1 make life a whole lot easier!
Historically, converting spooled files on IBM i has been a bit of an arduous task, but in recent releases, it's become much easier. In April 2010, I wrote an article about how to convert AFP to PDF using native commands included in IBM i 6.1 at no charge. With the release of IBM i 7.1, we're fortunate that IBM has expanded on these abilities by adding a couple of neat features.
In IBM i 6.1, IBM added support to allow you to natively generate a PDF file from your application though the use of workstation customizing objects. In order to do this, you need to define or override a printer file with a device type of *AFPDS to use a workstation customizing object. You can use *PDF for the WSCST parameter, or you can specify a workstation customizing object with an attribute of CTXFORM. In any event, you also must identify the stream file where the resulting PDF output is created. The application can now generate a PDF file rather than the AFP spooled file. This support requires the IBM Transform Services for i and PASE licensed programs to be installed. Both of those licensed programs come with your OS at no charge.
What's New in 7.1?
In IBM i 7.1, we now have the ability to convert spooled files natively to PDF by using Systems Director Navigator for i. This feature is not supported in the System i Navigator client unless you have Infoprint Server installed. I would assume this is just IBM intentionally moving more features away from the heavy Navigator client toward the Web interface.
If you select a spooled file, you can click the menu option View As PDF. This does the native conversion and displays the PDF on the screen.
You can also use the "Export as > PDF > to client file system" option, but don't be fooled by the other options listed; they don't work unless you have Infoprint Server installed. The first option in the list, Export as > PDF > to client file system is the only one offering native support for conversion. You can export your spooled file to a PDF in any directory you have authority to on your IFS, a shared drive, or a directory on your local computer. You can't get much easier than this, and many products out there offer this same feature for a cost that you can now eliminate.
Couldn't IBM Just Add Native Support to CPYSPLF?
IBM i 7.1 PTF SI43471 augments the CPYSPLF command to now support copying spooled files into the Integrated File System (IFS)! IBM not only added new parameters to choose where the copied file is to be stored in the IFS, but also enabled support for the ability to choose a workstation customizing object (WSCST). By choosing an IBM-supplied WSCST, you can convert your spooled file to PDF and even TIFF (using either customizing objects QWPTIFFPB or QWPTIFFG4 ) or GIF (using QWPGIF) files on the fly. Unfortunately, there is no support yet for this PTF on IBM i 6.1, which is yet another reason for moving on up to 7.1 in the near future.
You need to install licensed programs IBM Transform Services for i and Transforms – AFP to PDF Transform for this feature to work.
To take advantage of this new function, specify the new *TOSTMF special value on the CPYSPLF TOFILE parameter. The spooled file will be converted based on the workstation customizing object specified in the Workstation customizing object (WSCST) parameter and the output placed in the stream file specified in the To stream file (TOSTMF) parameter. You must ensure the path exists on the IFS where you want to have the spooled file generate beforehand. It, of course, will not create directories as part of the conversion.
Here are the new parameters included with the CPYSPLF command, taken from the PTF cover letter:
To stream file (TOSTMF)
Workstation customizing object (WSCST)
With the new CPYSPLF command, you can easily adjust a CL program in order to take your spooled file to the IFS as an image or PDF. The practical applications for this are numerous. Imagine if you wanted to automatically email your customers an invoice as a PDF or TIFF file without doing a whole lot of work. Or dump your old payroll spooled files onto a file server as PDFs? IBM has made conversion tasks a heck of a lot easier.
as/400, os/400, iseries, system i, i5/os, ibm i, power systems, 6.1, 7.1, V7, V6R1
|Last Updated on Wednesday, 13 July 2011 00:00|