Specifying a file name when printing to PDF using Office Integrator
From Support
This source example allows iSeries Office Integrator users to automate the MS Word mail merge and printing process to print selected Microsoft Word documents to PDF files and control the PDF file name.
We have recently updated the Office Integrator to support an Open Source print driver named: PDFCreator
As a usage example, the following scenario might work for printing to selected PDF files from a MS Word document. This example writes to a PDF file named C:\RJSTEMP\PDFFILE.PDF
Initial Setup Steps
1.) Install the PDF Creator Print Driver on Windows 2003 http://wiki.rjssoftware.com/wiki/index.php/PDF_Creator_Install
2.)Make sure you have the iSeries Office Integrator V1.1.77 or above loaded on the PC.
3.) Use the following command sequence with the iSeries Office Integrator
/* Set the output file name for PDFCreator Driver */
CHGVAR VAR(&CMDLINE) +
VALUE('PDFCREATOROPT~C:\RJSTEMP\PDFFILE.PDF~1~0~ ~ ')
/* Run the command to set output file name */
OFCRUNPC RMTSYS(*CURRENT) CMD(&CMDLINE) OPTION
(*OTHER)
/* Call Merge Metter Print with PDFCreator as the Print Driver */
CHGVAR VAR(&CMDLINE) +
VALUE('MERGELETTERPRINT~C:\Program +
Files\RJSOFFICE\MERGE1.DOT~C:\Program +
Files\RJSOFFICE\RJSCUST.TXT~' |< 'PDFCreator'
|< '~ ~ ~ ~')
/* Run the command to run a mailmerge and print to PDF */
OFCRUNPC RMTSYS(*CURRENT) CMD(&CMDLINE) OPTION
(*WORDOLE)
/* Call Function to Make Sure PDFCreator Queue is Empty After Printing */
/* This means the document printing to PDF has completed */
CHGVAR VAR(&CMDLINE) VALUE('WAITPDFCREATOR~')
OFCRUNPC RMTSYS(&RMTSYS) CMD(&CMDLINE) +
OPTION(*OTHER)
After running the mail merge, printing it to the PDFCreator printer driver, the PDF output file should now exist as C:\RJSTEMP\PDFFILE.PDF
