marlowe
24th May 2002, 01:14
:confused: I'm trying to insert PCL control codes into a report. I have defined a string and I'm filling it with the relevant code. The problem I have is that the printer doesn't respond to the codes. It seems as if the escape characters are being stripped out, so that the printer just prints the remainder of the string. I tried outputting to a file and examining the output using vi, and it the escape characters weren't there.
I'm filling the string using
str.1 = chr$(27) & "(s4116T"
where chr$(27) should be the escape character. Does anyone have any suggestions where I'm going wrong?
shah_bs
24th May 2002, 05:44
I would suggest the following approach:
- Make a copy of the printer driver and and use 'pfontnn' attributes to define the desired fonts using the escape sequences. (Look at hp_lj4 for an example).
- Define a new Device Data definition to make use of the printer driver just defined.
- Thereafter, associate the user font to the field in the report layout and recompile.
RobertB
13th July 2002, 11:26
Hi marlowe,
I assume you're trying this from within a Report Script - here you can use the pp$ function, which will send escape codes directly to the printer. Example:
spool.pr.line = pp$("PW0.2;PU16,4.5;EA270,180;")
spool.line()
(this example uses a mm-based coordinate system, but it should be clear what is happening - set pen-width; pen up to start-position; draw box from start- to end-position). Or:
pcl.symbol.10U = esc.char & "(10U" & esc.char
pcl.font = pcl.symbol.10U & "(s1p12.00v0s3b16602T" | Arial 12...
spool.pr.line = pp$(pcl.font)
spool.line()
You can also use the pf$ function in a similar manner if you only want to change the font.
Check out Baan Windows Printing docs for more info on these functions.
HTH