This section shows a way to create a PDF file in a workflow via a command call on the IBM i platform.
This workflow has been setup:
Overview:
The workflow above can be called by a CL program that looks like below:
PGM
DSPJOBLOG OUTPUT(*PRINT)
IFORMNG2/NG2CMD COMMAND(PDF2) FILE(QPJOBLOG) +
SPLNBR(*LAST) OUTFILE(WORKFLOW.PDF) +
DIR('/IFORMNG2') TEMPLATE('generic.ift') +
CONFLICT('Overwrite')
ENDPGM
In the program the joblog of the current job is converted into a spooled file and this is merged into a PDF file. All is setup on the command, so that it will create the PDF file: /IFORMNG2/WORKFLOW.PDF based on a merge with the template, generic.ift. If there already is a file with this name in the output directory, then the original file will be overwritten.