unit UnitDemo;

interface

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

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Button1: TButton;
    Button3: TButton;
    Button2: TButton;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button3Click(Sender: TObject);
var
   Printer : OleVariant;//    
begin
//  
  Printer := CreateOleObject('AddIn.RcpPrn51');
// 
  Printer.DeviceEnabled := True;
//    
  Printer.RaiseException := True;
//   ( 1)
  Printer.Alignment := 1;
//  
  Printer.Caption := '********************';
// 
  Printer.AddText;
//   
  Printer.Caption := ' !';
//    
  Printer.AddText;
  Printer.Caption := '********************';
  Printer.AddText;
//   
  Printer.FileName := 'atollogo.bmp';
//   
  Printer.AddPicture;
  Printer.Caption := '';
  Printer.AddText;
//,      
  Printer.Copies := 1;
//     
  Printer.BackgroundPrint := False;
//     
  Printer.ShowProgress := True;
// 
  Printer.PrintTask;
// 
  Printer.DeviceEnabled := False;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
   Printer : OleVariant;//    
   i : integer;
begin
//  
  Printer := CreateOleObject('AddIn.RcpPrn51');
// 
  Printer.DeviceEnabled := True;

//    
  i := Printer.CapCharCount;
  Printer.Caption := StringOfChar('=',i);
//  
  Printer.AddText;
//   , ,    
  Printer.Alignment := 1;
  Printer.FontDblHeight := True;
  Printer.FontDblWidth := True;
  Printer.FontBold := True;
  Printer.Caption := '  000033';
  Printer.AddText;
// 
  Printer.Alignment := 0;
  Printer.FontDblHeight := False;
  Printer.FontDblWidth := False;
  Printer.FontBold := False;
//
  Printer.Caption := StringOfChar('=',i);
  Printer.AddText;
//         ( )
  Printer.TextNewLine := False;
  Printer.Caption := ' : ';
  Printer.AddText;
  Printer.TextNewLine := True;
  Printer.FontBold := True;
  Printer.Caption := '  ';
  Printer.AddText;
//
  Printer.FontBold := False;
  Printer.TextNewLine := False;
  Printer.Caption := '     : ';
  Printer.AddText;
  Printer.TextNewLine := True;
  Printer.FontBold := True;
  Printer.Caption := ' 10   2';
  Printer.AddText;
//
  Printer.FontBold := False;
  Printer.TextNewLine := False;
  Printer.Caption := '     : ';
  Printer.AddText;
  Printer.TextNewLine := False;
  Printer.FontBold := True;
  Printer.Caption := '06.09.02';
  Printer.AddText;
  Printer.FontBold := False;
  Printer.Caption := '     : ';
  Printer.AddText;
  Printer.FontBold := True;
  Printer.Caption := '19:17:32';
  Printer.TextNewLine := True;
  Printer.AddText;
  Printer.FontBold := False;
//
  Printer.Caption := StringOfChar('=',i);
  Printer.AddText;
//       ,   
  Printer.FontBold := True;
  Printer.Caption := '   ';
  Printer.AddText;
  Printer.Alignment := 2;
  Printer.Caption := '     -         ';
  Printer.AddText;
  Printer.FontBold := False;
  Printer.Caption := StringOfChar('=',i);
  Printer.AddText;
//          
  Printer.Alignment := 0;
  Printer.Caption := ' ';
  Printer.AddText;
  Printer.Alignment := 2;
  Printer.Caption := '54.00  *   7.000   =    378.00';
  Printer.AddText;
  Printer.Alignment := 0;
  Printer.Caption := '  ';
  Printer.AddText;
  Printer.Alignment := 2;
  Printer.Caption := '63.00  *   7.000   =    441.00';
  Printer.AddText;
  Printer.Alignment := 0;
  Printer.Caption := ' ';
  Printer.AddText;
  Printer.Alignment := 2;
  Printer.Caption := '63.00  *   8.000   =    504.00';
  Printer.AddText;
  Printer.Alignment := 0;
  Printer.Caption := '  ';
  Printer.AddText;
  Printer.Alignment := 2;
  Printer.Caption := '68.00  *   4.000   =    272.00';
  Printer.AddText;
  Printer.Alignment := 0;
  Printer.Caption := '  ';
  Printer.AddText;
  Printer.Alignment := 2;
  Printer.Caption := '58.00  *   7.000   =    406.00';
  Printer.AddText;
//
  Printer.Caption := StringOfChar('=',i);
  Printer.AddText;
//      
  Printer.FontDblHeight := True;
  Printer.FontBold := True;
  Printer.Alignment := 2;
  Printer.Caption := '   :      2 001.00';
  Printer.AddText;
  Printer.Caption := '   :        210.00';
  Printer.AddText;
  Printer.Caption := '   :      1 791.00';
  Printer.AddText;
  Printer.FontBold := False;
  Printer.FontDblHeight := False;
//
  Printer.Caption := StringOfChar('=',i);
  Printer.AddText;

//.     
  Printer.Copies := 1;
//     
  Printer.BackgroundPrint := False;
//      
  Printer.ShowProgress := True;
//  
  Printer.PrintTask;
// 
  Printer.DeviceEnabled := False;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Close;
end;

end.
