Midrange News for the IBM i Community


Posted by: Jeff Masak
IT Developer
The Boldt Co
Appleton, WI
iSeries IFS PDF's Questions
has no ratings.
Published: 11 Oct 2012
Revised: 23 Jan 2013 - 4072 days ago
Last viewed on: 17 Mar 2024 (10260 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

iSeries IFS PDF's Questions Published by: Jeff Masak on 11 Oct 2012 view comments(9)

Is there a command or series of commands that will allow combining PDF's on the IFS into one PDF?

Also is there a way to print PDF's from the IFS to a user's default Netork Printer?

Trying to batch PDF's so they are printed all together for a user.

 

Thanks Jeff

 

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: Ringer
Premium member *
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 5 months 7 days 1 hours 9 minutes ago

If your printers are "PDF aware" by sniffing the byte stream, just read the PDF in RPG with open(), read() API's as straight ASCII (no conversion to EBCDIC) and write to that AS400 printer device as ASCII.

Chris Ringer

Posted by: DaleB
Premium member *
Reading, PA
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 5 months 6 days 15 hours 35 minutes ago

Writing a program seems like overkill. See RFILE in QShell utilities. Example 2 is what you're looking for.

Posted by: dag0000
Premium member *
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 5 months 6 days 15 hours 10 minutes ago

To print the PDF's you could try to FTP the file to the network printer in question

Posted by: jmasak
Premium member *
Appleton, WI
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 5 months 2 days 11 hours 57 minutes ago

Thanks to all for the replies, I would like to use the RFILE in Qshell, but am not sure how to use the command.  Just getting started and trying to figure out Qshell.  Thanks Again  Jeff

Posted by: Paulster
Premium member *
Sweden and The Netherlands
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 5 months 1 days 19 hours 50 minutes ago

Google's your friend:

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Frzahz%2Frfile.htm

Posted by: DaleB
Premium member *
Reading, PA
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 5 months 1 days 15 hours 41 minutes ago

The sample is a shell !--script--:

before='ovrprtf qprint devtype(*userascii) spool(*yes)'
after="lpr file(qprint) system(usrchprt01) prtq('rchdps') transform(*no)"
cat -c mydoc.ps | Rfile -wbQ -c "$before" -C "$after" qprint

"before" and "after" are !--script-- variables. The actual command to execute is the "cat...", where $before and $after are substituted with their values.

To run a utility from CL you can use QSH command, and pass the entire command string as a parameter. Whether you use separate variables for the before and after (override) commands is up to you; might make it easier to understand.

Note the embedded single quotes in the after variable, which is why they changed the delimiter to double quotes. You won't have that luxury in CL.

DCL &BEFORE *CHAR LEN(100)
DCL &AFTER *CHAR LEN(100)
DCL &CMD *CHAR LEN(500)
DCL &HOSTNAME *CHAR INZ('hostname')
DCL &RMTOUTQ *CHAR INZ('someoutq')
/* Setup before and after override commands, which are parameters to Rfile */
CHGVAR &BEFORE 'OVRPRTF QPRINT DEVTYPE(*USERASCII) SPOOL(*YES)' +
CHGVAR &AFTER 'LPR FILE(QPRINT) SYSTEM(' *CAT *HOSTNAME +
       *CAT ') PRTQ(''' *CAT &RMTOUTQ *CAT ''') TRANSFORM(*NO)'
/* Now setup the QShell command, adding in the overrides */
CHGVAR &CMD 'cat -c mydoc.ps | Rfile -wbQ -c "' *CAT &BEFORE +
       *CAT '" -c "' *CAT '" qprint'
/* Now execute it */
QSH CMD(&CMD)

This is off the cuff, but should give you an idea of where you need to go.

See QShell utilities cat and Rfile for the parameter details. The -c on cat, for example, means do the copy with no conversion; which you need for binary files like a PDF. The switches (-c, -wbQ, and so on) are case sensitive in shell !--script--s. The embedded CL commands are parameters to the Rfile command, inside quoted strings; inside the quotes they need to follow normal CL command syntax, just like you were running them from the command line.

Posted by: jmasak
Premium member *
Appleton, WI
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 5 months 1 days 14 hours 57 minutes ago

Thanks again to all

 

Posted by: DaleB
Premium member *
Reading, PA
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 5 months 1 days 13 hours 37 minutes ago

I think I missed concatenating &AFTER in the build of &CMD. Hopefully you can figure that one out.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: iSeries IFS PDF's Questions
Posted: 11 years 4 months 24 days 14 hours 10 minutes ago

Jeff, now that its seems to be working, try my CPYFRMPDF command in COZTOOLS. The runtime is free if you haven't licensed it yet. So download and give it a try and see if it does what you want.