Hi.
I am using Windows XP, SP3 with Lazarus Version #1.2.4, FPC version 2.6.4.
I am trying to put text onto a printer canvas, using a unit converted from Delphi 4 :-
procedure TMainForm.FilePrintClick(Sender: TObject);
Var
I, LineHeight, LinesPerPage, LineCount, X, Y: Integer;
R: TRect;
S: String;
Printer: TPrinter;
begin
If PrintDialog.Execute then
begin
Printer.Title := 'ScratchPad - ' + OpenDialog.FileName;
Printer.Canvas.Font := Memo.Font;
Y := Printer.YDPI;
LineHeight := Abs(MulDiv(Printer.canvas.Font.Size, Y, 72));
Inc(LineHeight, (LineHeight * 4) Div 10);
LinesPerPage := (Printer.PageHeight Div LineHeight) - 4;
LineCount := 4;
Printer.BeginDoc;
R.Top := LineHeight;
R.Left := 50;
R.Right := Printer.PageWidth;
R.Bottom := LineHeight * 2;
DrawText(Printer.handle, PChar(OpenDialog.FileName), -1, R, DT_Center);
Compiling fails at the DrawText line with the message
Error: identifier idents no member "handle".
How do I correct this line to suit Lazarus?