[Lazarus-es] imprimir tickeadora: ticket y testigo
Claudio Romero
clauslack en gmail.com
Jue Sep 27 21:18:24 CEST 2012
// Aca paso un ejemplo, funciona bien en una matricial Epson FX-870.
// Saludos.
//---------
unit ImpDuplicado_;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls,strutils,printers, PrintersDlgs;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure ImprimirDuplicadoCadenaRaw(S:String);
const Kenter=CHR(13)+CHR(10);
ComienzoDuplicado=40;
var Written: Integer;
begin
Written:=0;
S:=S+DupeString(' ',ComienzoDuplicado-Length(S))+S;
S:=S+Kenter;
Printer.Write(S[1], Length(S), Written);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Printer.PrinterIndex:=0;
Printer.RawMode := True; Printer.BeginDoc;
ImprimirDuplicadoCadenaRaw('RAZON SOCIAL');
ImprimirDuplicadoCadenaRaw('LOS ALAMOS SEGUROS');
ImprimirDuplicadoCadenaRaw('25 DE MAYO 1545');
Printer.EndDoc;
end;
initialization
{$I unit1.lrs}
end.
More information about the Lazarus-es
mailing list