|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by subicz in Delphi Printing
I'm using a Citizen CT-S2000 POS (Point Of Sale) printer from my Delphi code.
I try to send some escape sequences to the printer using the OPOSPosPrinter driver.
It seems, if the sequence contains #0 character, it simply does not work, as the string will be cut there. The PrintNormal function has a WideString parameter for the string, and the OCX has a BSTR variable for that.
Thanks in advance!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
|
procedure TestPrint;
var
LPrinter: TOPOSPOSPrinter;
s: WideString;
begin
LPrinter := TOPOSPOSPrinter.Create(nil);
LPrinter.Open('CTS2000.CITIZEN.POSPrinter');
LPrinter.ClaimDevice(1000);
LPrinter.DefaultInterface.Set_DeviceEnabled(TRUE);
s := #27'L'; // page mode
s := s + #27'W' + chr(0) + chr(0) + chr(0) + chr(0) + chr(0) + chr(1) + chr(0) + chr(1); // defining the print area
s := s + #27'$' + chr(0) + chr(0); // text horizontal position
s := s + #29'$' + chr(0) + chr(0); // text vertical position
s := s + 'ÁrvíztqrQ tükörfúrógép';
s := s + #12; // print and leaving page mode
LPrinter.PrintNormal(PTR_S_RECEIPT, s); // print
LPrinter.Close;
LPrinter.ReleaseDevice;
LPrinter.Free;
end;
|
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625