How to print to a local printer from ONECase?


You could use the QIMGCVTI API to convert the .TIF to AFPDS, but I believe the API doesn't provide the option to put the resulting APFDS to a DB file (just IFS file if I remember correctly). You will need to get the AFPDS copied from the IFS file to a DB file. Make sure the AFPDS generated has a 'begin page segment' and an 'end page segment' before and after the AFPDS image data. Once all that is accomplished, you can use the CRTPAGSEG OS command to generate a page segment object. 

I believe there are other ways to do the same thing from the PC. 

Std database files can be accessed via IFS path/name, as QSYS.LIB file system is part of IFS. It may be worthwhile to try creating a database file (with an empty member), and specify that file/member as output to QIMGCVTI. This might (?) eliminate the step of copying from another IFS stream file to the DB file.

CRTPF FILE(MYLIB/MYDBFILE) ... MBR(AFPLOGO) 

Example IFS syntax for QIMGCVTI output: 

/QSYS.LIB/MYLIB.LIB/MYDBFILE.FILE/AFPLOGO.MBR 

You can you the Client Access AFP printer driver on a PC to create both page segments and overlays. You can also find the latest version of this driver on the IBM Printing Services web site at http://www.printing.ibm.com.




To elaborate on this a little further: 

1. Install the AFP print driver. Freely available with CA/400 or CA/400 Express.
When the installation asks for the device type specify IBM 3812 

2. Change the AFP printer to print to a PC file 

3. Load your TIF into your favorite windows application. Size it, rotate it, crop it
as you see fit. 

4. Change the properties of the printer to specify that you want to create a
page segment (also uncheck the Compression box. Using compression can
cause some problems with older versions of PSF) 

5. Print the TIF. When the File Prompt appears, you can store the file on your
local PC or if you are using Netserver, into an IFS directory 

6. On your AS/400 use the CRTPF to create a physical file to hold the Page
segment data. Specify a record length of 80 and LVLCHK(*NO) 

7. Using your favorite transfer utility (Binary FTP works best) transfer the PC
file to the Physical file you just created. If you stored the PC file in the IFS use
CPYFRMSTMF with CVTDTA(*NONE) 

8. Use the CRTPAGSEG command to create the page segment object. 

You can use this same method for creating overlays.