[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.

Question
[x]
Attachment Details

How do I send #0 character to the POS driver as escape code?

Asked by subicz in Delphi Printing

Tags: POS Printer Delphi

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;
[+][-]09/17/09 12:52 AM, ID: 25353630Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/06/09 02:50 PM, ID: 25510295Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/16/09 01:31 AM, ID: 25587739Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/16/09 02:11 AM, ID: 25587869Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625