Printing from a memo or synmemo/edit lazarus / 8-Other ---------------------------------------------------------------------- davesimplewear · 2010-01-22 22:42 Hi, I am having aproblem printing from any of the memo components, I searched the forum and googled the way to print but the code produces overprinting eg. a 50 line memo will print in about 4 lines from the printer making a garbled mess. The code that is used is as follows: procedure PrintTStrings(Lst : TStrings) ; var   I,   Line : Integer; begin   I := 0;   Line := 0 ;   Printer.BeginDoc ;   for I := 0 to Lst.Count - 1 do begin     Printer.Canvas.TextOut(0, Line, Lst);     {Font.Height is calculated as -Font.Size * 72 / Font.PixelsPerInch which returns      a negative number. So Abs() is applied to the Height to make it a non-negative      value}     Line := Line + Abs(Printer.Canvas.Font.Height);     if (Line >= Printer.PageHeight) then       Printer.NewPage;   end;   Printer.EndDoc; end; Everything looks all right, I can't see the error, can anyone point me in the right direction? Regards Dave ---------------------------------------------------------------------- theo · 2010-01-22 22:50 I don't know exactly what you see, but how does the text in the Memo look if you set property WordWrap:=false ? Do you see 4 or 50 lines then? ---------------------------------------------------------------------- davesimplewear · 2010-01-23 01:42 Thanks for the reply Theo, my problem is the printer output, it is over printing on the same line sometimes and sometimes over approx 4 lines, the screen output is ok, hence the query whether my printer code was correct. Regards Dave ---------------------------------------------------------------------- Troodon · 2010-01-23 06:30 Instead of Printer.Canvas.Font.Height try Printer.Canvas.TextHeight('I'). ---------------------------------------------------------------------- davesimplewear · 2010-01-23 06:42 Thank you Troodon, that worked, many thanks  Regards Dave