Graphics
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I want to print to forms. Every customer has a special logo and this logo must also be print to the form. How can I save and print a graphic with Informix-4GL 7.2 (Online)?
I've done it, but it was complicated, and it is printer dependent. I hope there's an easier way, but what I did was load the jpeg with an image-viewer (Irfan-view), save it as a pcx file, load that into WordPerfect, change my printer port options to print to file, printed the logo so the Logo was written in pcl (for my HP laserjet), wrote a C prog to strip off the chars in the file before and after the pcl graphics start and stop command, wrote a C prog to print the part of the file that are printable characters as the printable string surrounded by quotes, and print the non-printable characters as: ASCII(x), where x is the decimal of the character. Had it add line feeds before each escape char (ASCII(27)) so the lines were manageable. Added "PRINT " before each line and a semi-colon at each end save the last. Added a positioning command and it was ready to go. (In the WordPerfect doc, I changed the graphics quality to high). Later I changed the program to load the strings into an array and print the array. But I had to treat ASCII(0) in the array special, because ASCII(0) only prints ASCII(0), if you load ASCII(0) into a string, Informix treats it as a space (RTFM). In article <3A4C51AF.856AE782@t-online.de>, Ihr Name <IhrName@t-online.de> wrote: > I want to print to forms. > Every customer has a special logo and this logo must also be print to > the form. > How can I save and print a graphic with Informix-4GL 7.2 (Online)? > Sent via Deja.com http://www.deja.com/
The best way is to create a 'C' function to format the graphic for printing and if you store the graphic in a BLOB column instead of a flat file you may find it best to make that an ESQL-C function to retrieve AND print the logo. Just make the function 4GL callable (not difficult) and call it from the 4GL program. Note that you may find it difficult to integrate the logo and form text if you are using a REPORT module as the report gathers the output in a temp table and dumps it to the printer when the report is FINISHed. So while the mainline of the report may be best in 4GL, if the logo is not to appear at the top you may want to handle the output in 'C' completely. Art S. Kagel Ihr Name wrote: > > I want to print to forms. > Every customer has a special logo and this logo must also be print to > the form. > How can I save and print a graphic with Informix-4GL 7.2 (Online)?
Once you get the logo coded in a way your printer can understand, save the pcl code (or whatever) to disk, and use the "print file" command in the Report. (but not in the header - "print file" illegal there): report ... format before group of ... skip to top of page print ascii(27), "&f0S", # remember current location ascii(27), "*p675x-35Y"; # move to logo location print file "W_EXT_BB_pcx.pcl" # print logo print ascii(27), "&f1S"; # return to save location but not: page header print file "wash_logo.pcl"; | | Files cannot be printed within report headers | or trailers. | See error number -4310. > Ihr Name wrote: > > > > I want to print to forms. > > Every customer has a special logo and this logo must also be print to > > the form. > > How can I save and print a graphic with Informix-4GL 7.2 (Online)? > Sent via Deja.com http://www.deja.com/