procedure Imprimir;
var
iPrinter: TPrinter;
PrinterY: Integer;
begin
iPrinter:= TPrinter.Create;
PrinterY:= 0;
iPrinter.Title:= 'MEUSISTEMA - Cupom';
//Se a impressora estiver imprimindo, espera
While Printer.Printing Do
Sleep(100);
iPrinter.BeginDoc;
iPrinter.Canvas.Font.Name:='Courier';
iPrinter.Canvas.Font.Style:=[fsBold];
iPrinter.Canvas.Font.Size:=13;
iPrinter.Canvas.Font.Size:=18;
iPrinter.Canvas.TextOut(0,PrinterY,'CUPOM TESTE SISTEMA');
Inc(PrinterY,38);
iPrinter.Canvas.Font.Size:=13;
iPrinter.Canvas.TextOut(0,PrinterY,'TESTE'); Inc(PrinterY,30);
iPrinter.Canvas.TextOut(0,PrinterY,'--------------------'); Inc(PrinterY,30);
iPrinter.Canvas.Font.Size:= 18;
iPrinter.Canvas.TextOut(0,PrinterY,'OUTRO TESTE');
Inc(PrinterY,50);
iPrinter.EndDoc;
iPrinter.Free;
Relacionado