unit unitmain; {$mode objfpc}{$H+} interface uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, Printers; type { TForm1 } TForm1 = class(TForm) Button1: TButton; btnZPL: TButton; Label1: TLabel; Label2: TLabel; Label3: TLabel; ListBox1: TListBox; Memo1: TMemo; procedure btnZPLClick(Sender: TObject); procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { private declarations } procedure PrintString(S:String); procedure PrintStream(St:TStream); procedure PrintSample; procedure PrintZebraSample; function SetCurrentPrinter: boolean; public { public declarations } end; var Form1: TForm1; implementation {$R *.lfm} const CRLF = #13#10; { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin // fill in the printer list Listbox1.Items.Assign(Printer.Printers); end; procedure TForm1.PrintString(S: String); var Written: Integer; begin Printer.Write(S[1], Length(S), Written); end; const MaxBufSize = 256; procedure TForm1.PrintStream(St: TStream); var Written: Integer; Buffer: array[0..MaxBufSize-1] of byte; begin while St.Position