Алексей Халецкий

Алексей Халецкий (Автор тем)

Выбрать дату в календареВыбрать дату в календаре

Страницы: 1
Godex DT2x печать через Delphi
 
Добрый день! Не могу заставить принтер печатать. Написал код, вроде соответствует мануалам, но принтер молчит. Вот пример кода:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;


const
TestLib = 'ezweb.dll';


procedure openport(name:PChar); stdcall; external TestLib ;
procedure beginjob(a, b, c, d, e, f:Integer); stdcall; external TestLib;
procedure endjob; stdcall; external TestLib;
procedure sendcommand(command:PChar); stdcall; external TestLib;
procedure closeport; stdcall; external TestLib;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
openport('USB001'); // 0-> LPT1; 1-> COM1; 2->COM2
beginjob(40, 7, 2, 0, 2, 0);
sendcommand('^XSET,CODEPAGE,16');
sendcommand('^Q719,3');
sendcommand('^W27');
sendcommand('^H10');
sendcommand('^P1');
sendcommand('^S2');
sendcommand('^AD');
sendcommand('^C1');
sendcommand('^R0');
sendcommand('~Q+0');
sendcommand('^O0');
sendcommand('^D0');
sendcommand('^E12');
sendcommand('~R200');
sendcommand('^L');
sendcommand('Dy2-me-dd');
sendcommand('Th:m:s');
sendcommand('BE,30,42,3,7,100,0,1,123456789012');
sendcommand('E');
endjob();
closeport();
end;

end.
Страницы: 1