Re: Report Font Sizes
Posted in 1996
Don't do this (setting up printer codes in your code). It will be a maintenance night mare the day you change printers (may be you allready have more than one type of printers). Either define your own print sequences (generic once) for each font size/attribute you need. Then print these in the way described here and either pipe it through a filer, or better set up each printer with its filter, that replaces your generic codes with whatever each printer requires. If you don't want to use fileters at least read the necessary sequences from the database or a file into variables and use those. Than you can easily use an extra parameter when reading to do it for the appropriate printer. And yes, you do have the problem that 4GL (and ace) counts characters (bytes) printed including your codes. If you ever use column xx in your print statement it will be off by the number of bytes in your printer codes. All this doesn't help much of course if you have a postscript printer. In that case you have two options. Either print postscript - we have done that, but it isn't easy. Alternatively you can actually write a postscript program that you send to the printer that then reads characters and print them. This would then also have to understand codes to change font and other attributes. It's not easy to write something like that, but it is doable. However I wouldn't do it. Most laser printers now adays also understand PCL and that works nicely with the above system with printer codes. "Garrett Sienkiewicz" <garrett@data-design.com> wrote: :There is no clear cut answer to this. The answer depends :on what hardware/software combination your have. An epson lq-2550 would be :totally different from an Intermec bar code printer, and both of these :would be :totally different for a postscript printer. :Typically, using your printer documentation, you would determine the escape :sequences to change fonts and, using the ascii() function, send those to :the printer. Something like this: : define esc char(1) : define print_seq char(12) : : let esc = ascii(27) : let print_seq = esc, "[m...." (whatever the sequence is) :Then in your report, you would simply do : print print_seq; (note the semi-colon, no new-line) :The potential pitfalls: : 1) If you change point size, you must figure out when to do page ejects : 2) Likewise, changing pitch could produce a line longer or shorter than : expected. I think that the report writer keeps track of how many bytes : that you have printed on a line (not sure about this). :If you're still stuck, send me some email, and I'll see if I can dig up :some :sample code. :-- :---------------------------------------------------------------------------- :---- :Garrett Sienkiewicz :Database Designs, Inc. :309 W. 13 Mile Rd. :Madison Heights, Mi. 48071 :(810) 585-9928 :garrett@data-design.com :Barry.Johnson@csi.wr.com.au wrote in article :<52vfvk$sgh@cssun.mathcs.emory.edu>... :> I need to print certificates using different font sizes. Can anyone tell :me :> what I need to do in the report section to change the print font sizes :and :> attributes? :> :> Thanks in advance, :> Barry Johnson :) :> bjohnson@csi.wr.com.au :> :> Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org