Set-Printer Justification (OpenInsight 32-Bit)
At 30 JUN 2008 11:52:15AM Richard Richter wrote:
This is probably something very easy but I'm not getting it. I'm trying to change from left justification to center justification. I'm printing along just fine in left with this font command:
v=Set_Printer("FONT","Arial":@FM:12:@FM:"L")
Then I want to change to center justification and I use the following command:
v=Set_Printer("FONT","Arial":@FM:12:@FM:"C")
It contiues to print left justified.
What am I doing wrong?
Thanks,
Richard Richter
At 30 JUN 2008 12:52PM Sean FitzSimons wrote:
Richard,
The code you posted seems fine. I took your code and ran the following test and received lines of text with the requested justification.
spStatus=Set_Printer("FONT","Arial" : @fm : 12 : @fm : "L")
spStatus=Set_Printer("TEXT", "A left justified line of text.")
spStatus=Set_Printer("FONT","Arial" : @fm : 12 : @fm : "C")
spStatus=Set_Printer("TEXT", "A centered justified line of text.")
spStatus=Set_Printer("FONT","Arial" : @fm : 12 : @fm : "R")
spStatus=Set_Printer("TEXT", "A right justified line of text.")
I suggest that after the Set_Printer call you interrogate the return value. As in:
spStatus=Set_Printer("FONT","Arial" : @fm : 12 : @fm : "C") if spStatus < 0 then * Do some error handling end spStatus=Set_Printer("TEXT", "A centered justified line of text.") if spStatus < 0 then * Do some error handling end
Sean
At 30 JUN 2008 01:31PM Richard Richter wrote:
I checked the returned value and in both cases it is 1. I then tried it on several printers and get the same result.
Any thoughts on how to correct the problem.
Richard Richter
At 30 JUN 2008 07:31PM Colin Rule wrote:
Are you using the TEXT command or TEXTXY.
When using TEXTXY, I calculate the length using CALCTEXT and then determine the XY position from that.
Colin