The assumption is that you are trying to print to a HP Laser printer using PCL5 escape sequences.
Create a text file using vi, or whatever to print BOLD_ON Hello World BOLD_OFF Bye.
Send this file to the printer with the lp command.
Does it print the way you want it to?
Next create the report file in Informix, and instead of sending the file to the printer, save it and compare it to the hello world file.
Adjust the Informix program till you get the desired output.
Lastly send the Informix output to the printer.
The attached file will print the word "BOLD" in bold, and the word "Regular" in the printer default font. My print spooler also adds "<esc>&k2G" to the beginning of the file to turn on conversion of line feed to carriage return/line feed.
If you print this file using the lp command, does it print correctly?
If you create a file from your Informix program, does it create the same sequence of characters?
Try sending the file to the printer directly.
Use "netcat" for a network connected printer, or "cat" for a directly connected printer.
If this works, then you are left with the problem of how to either bypass the spooler, or create a new print destination that does not modify the incoming print file.
How are are you ? Thanks again for the reply. I am not a network person, Could you please assist me with parameters on how I can use and implement netcat so that I can use it in my informix-4gl print program or on command line.
Where hostname is ip address and port_number is tcp port number.
For locally attached printer
cat reportfile >/dev/devicename
Where devicename is the actual name of the device (lp, lp1, ttys1 etc)
In both instances, reportfile has to contain all the required escape sequences, beginning with at least:
<esc>&k2G #convert lf to crlf
and should end with another reset ( to be nice to the next person to use the printer.)
If your system does not have netcat, you can download it from here The GNU Netcat -- Official homepage