IBM Support

Creating a one page PDF file from a spooled file

How To


Summary

Customers who wish to create a short version of a large spooled file can create a one page PDF file using the CPYSPLF command and IBM i Transform Services.

Objective

Create a one page PDF file from a large spooled file by using the PAGERANGE spooled file attribute.

Environment

IBM i with IBM Transform Services installed. For the purposes of this document, 

Steps

First you need to set the PAGERANGE of the spooled file to be your desired length. For an existing spooled file you can use WRKJOB or WRKSPLF to access the spooled file, and then take a 2 on the spooled file to change the attributes of the PAGERANGE option. Then you would use the CPYSPLF command to copy the spooled file to a stream file using the *PDF Workstation Customizing Object. Alternately, you can use the OVRPRTF to create your spooled file with the PAGERANGE already set. Both have the same result.

In this example, I will override the printer file of a spooled file that I know will be more than one page to set the PAGERANGE to (1 1) and then use the CPYSPLF command to create a short version of the spooled file on the IFS.
  1. OVRPRTF FILE(QSYSPRT) PAGERANGE(1 1) OVRSCOPE(*JOB)
  2. WRKSYSVAL OUTPUT(*PRINT)
  3. CPYSPLF FILE(QSYSPRT) TOFILE(*TOSTMF) SPLNBR(1) TOSTMF('/kschroe/WRKSYSVAL.pdf') WSCST(*PDF)                           

The resulting PDF file is one page long, and the message received is: "Spooled file copied to /kschroe/WRKSYSVAL.pdf." This process works for both *AFPDS and *SCS spooled files.

Additional Information

 Note: The OVRPRTF command cannot be used to create a short version of what would be a longer PDF file DIRECTLY. If you use the OVRPRTF command like this, a PDF file will be created, but the PAGERANGE parameter will not have been be honored.

OVRPRTF FILE(QSYSPRT) DEVTYPE(*AFPDS) PAGERANGE(1 1)
TOSTMF('/kschroe/WRKSYSVAL.pdf') WSCST(*PDF) OVRSCOPE(*JOB)

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CUJAA2","label":"Print-\u003EPDF Infoprint Server-\u003ETransform Services 5770TS1"}],"ARM Case Number":"TS014726083","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.1.0;7.2.0;7.3.0;7.4.0;7.5.0"}]

Document Information

Modified date:
16 November 2023

UID

ibm17074501