Kopiując ten sam kod do Delphi drukuje normalnie, natomiast w lazarusie wydruk wyglada jak mini ściąga na 1/4 strony, nie wiem dlaczego, wielkosc czcionki wygląda jak 2 mimo ze jest 14, raz tylko po skompilowaniu rozmiescil tekst na calej stronie ale dalej w pomniejszonej czcionce. To przykładowy kod:
procedure TForm1.Button1Click(Sender: TObject);
var
S: string;
R: TRect;
i: integer;
function Wys(Procent: Integer): Integer;
begin
Result:=Procent*MyPrinter.PageHeight div 100;
end;
function Szer(Procent: Integer): Integer;
begin
Result:=Procent*MyPrinter.PageWidth div 100;
end;
function TextSzer(Tekst: string): Integer;
begin
Result:=MyPrinter.Canvas.TextWidth(Tekst);
end;
function TextWys(Tekst: string): Integer;
begin
Result:=MyPrinter.Canvas.TextHeight(Tekst);
end;
begin
if PrintDialog1.Execute then
begin
MyPrinter.Title:='Wnioski o meldunek';
MyPrinter.BeginDoc;
for i:=0 to ListBoxAdresat.ItemIndex do
begin
MyPrinter.Canvas.Font.Name:='TimesNew Roman';
MyPrinter.Canvas.Font.Size:=14;
MyPrinter.Canvas.Font.Style:=[fsUnderline];
S:= 'o udostępnienie danych ze zbiorów meldunkowych';
MyPrinter.Canvas.TextOut(Szer(7), Wys(24), S);
....................................................
end;
MyPrinter.EndDoc;
end;
Mam zainstalowane printers4lazarus