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.
I have a requirement from a client to print a Signature Captured from a Topaz device.
The requirement is to send the printed document (a receipt with the signature on it) to a PDF file and store it on the IFS.
Here is what I know:
However, sending a BMP to a SPOOL file in native (EPSON in this case) printer language doesn't convert to PDF using the IBM utilities.
So I'm wondering how to embed a BMP dynamically into a output SPOOL file so that it could then be copied to PDF using the built-in PDF support in IBM i.
Any suggestions?
Have you thought about doing it in php?
You have this signature in a bitmap file located on the IFS? I assume this is some sort of interactive job where the customer is selecting the signature the need printed. Does it make sense to open it up in a browser (like rpg to desktop)?
Let me describe a similar project that I do, and maybe it might help. We get in pdf's that are packing slips that we have to print out and put in the box on one customer. What I do is I call aaron bartell's (mowyourlawn.com) rpg2desktop from rpg and I have the pdf's located on a "windows" file server (could be the ifs if it is mapped drive), and that opens the pdf, and use a pdf wrapper prints the pdf, etc. (no php involved), but I wonder about using similar stuff to call a php command to take the bmp and make the pdf and put resultant pdf in the IFS and bypass the "spool file to pdf conversion".
chris
If you could convert the BMP into an AFP PAGSEG you could include the image with the AFPRSC DDS keyword.
Create the PAGSEG by printing to a file with the AFP print driver included with cllient access. Then IIRC upload the file and use the CRTPAGSEG cmd.
The trick will be automating the conversion. Maybe an approach would be to pre-create the PAGSEGs before calling the print pgm, keep track of their names or have a naming convention so the correct PAGSEG can be referenced on demand by the print program.
Tom, that's an interesting option. I've done that before with Logos and whatnot.
I'm wondering this...
i will with say "10,000" BMPs to be printed along with their invoices. This would be signatures captured during a sale.
Could I some how, generate an OVL or the PAGSEG using an API or CL command "on the fly" and then override the print file or pass that OVL name to the program/print-file at runtime? Since I can convert AFP to PDF using the system functions, it would be likely that an AFP generated SPOOL file would convert properly.
I started going down the AFPRSC keyword route one time for a logo. The problem is that BMP is not a supported file type. JFIF (aka JPG) and TIFF are.
My plan was to use Convert Image (QIMGCVTI, QimgCvtImg) API to convert the BMP to AFP, which I hoped would be compatible with either *GOCA or *IOCA on the AFPRSC() keyword. Wouldn't take a lot of experimentation to answer that question.
Unfortunately, I ultimately wound up using the Windows AFP printer driver, upload, etc., to convert my logo to an *OVL. I abandoned the convert image and AFPRSC() path, and never had a reason to go back to it, so I can't offer any sample code for you.
If you do try this, I suggest using AFPRSC to reference a JPG (*JFIF) as a stream file (any JPG of the appropriate size should do), and make sure that works with your conversion of spooled file to PDF, before attempting to add the convert image API.