Hello Lazarus Community, I have been googling around and cant find an answer to this problem,
the problem is:
1. When i print a string in a rawmode on a thermal printer using lazarus IDE 1.6.2 (windows 10)
the result are good, see the photo 1
2. but when i compile and build the same program on Raspberry pi, it turns out the font size are bigger.
see photo 2.
3. i am using these code to do the simple raw printing.
unit Printertestingg;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons, Printers;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
procedure PrintString(S:String);
procedure PrintSample;
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.PrintString(S: String);
var
Written: Integer;
begin
Printer.Write(S[1], Length(S), Written);
end;
const
MaxBufSize = 256;
procedure TForm1.PrintSample; // a kind of procedure
begin
//Mencetak header dan isi struk
PrintString('========Selamat Datang========='+LineEnding);
PrintString('=======Penyewaan Loker========'+LineEnding);
PrintString('Tercetak Pada '+DateTimeToStr(Now));//Menampilkan waktu sekarang
PrintString('Item : 1 Loker = Rp. 35000,-'+LineEnding);
PrintString('==============================='+LineEnding);
PrintString('Total = Rp. 35000,-'+LineEnding);
PrintString(LineEnding);
PrintString(' Simpan Struk pembayaran ini '+LineEnding);
PrintString('Struk ini akan digunakan untuk '+LineEnding);
PrintString('buka loker yang digunakan '+LineEnding);
PrintString('Barcode : '+LineEnding+LineEnding+LineEnding);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Printer.SetPrinter('POS-58'); //Deklarasi nama printer
Printer.Title := Caption;
Printer.RawMode := True;
Printer.BeginDoc;
PrintSample;
Printer.EndDoc;
end;
end.