Printer control lazarus / 16-Databases ---------------------------------------------------------------------- Jayndel · 2018-07-25 07:17 what is the alternative to  Delphi commands "Prn := TPrintObject.Create;" and "GetTextMetrics( Printer.Canvas.Handle,TextMetrics );" Any help greatly appreciated. ---------------------------------------------------------------------- dbannon · 2018-07-25 10:16 "any help" ? Not answering your question but ... use the  'Printers" unit. It declares a thing called Printer. You can then - printer.begindoc ... Printer.Canvas.TextOut(XOffset, YOffset, 'something'); printer.canvas.Line(LeftEdge, CurrentY, RightEdge, CurrentY); .... Printer.EndDoc; for an example, see https://github.com/tomboy-notes/tomboy- ng/blob/master/tomboy-ng/k_prn.pas Davo ---------------------------------------------------------------------- Thaddy · 2018-07-25 11:55 Quote from: Jayndel on July 25, 2018, 09:17:25 amwhat is the alternative to  Delphi commands "Prn := TPrintObject.Create;" and "GetTextMetrics( Printer.Canvas.Handle,TextMetrics );" Any help greatly appreciated. That object is not a standard Delphi object, afaik, but third party code it seems. The printers - as suggest above - unit is 100% Delphi compatible. The second question works out of the box on windows systems only: it is a windows API call. (And to be sure: DON'T use mode objfpc but mode delphi, although that is probably not related.) Also note that PRN is directly avalable when you use the printer unit instead or the printers unit. The difference is the line printer device vs the printer.canvas. ---------------------------------------------------------------------- howardpc · 2018-07-25 12:47 Printer.Canvas has a Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GetTextMetrics(out TM: TLCLTextMetric): boolean;function ---------------------------------------------------------------------- Thaddy · 2018-07-25 13:09 Quote from: howardpc on July 25, 2018, 02:47:33 pmPrinter.Canvas has a Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GetTextMetrics(out TM: TLCLTextMetric): boolean;function Tnx Howard, forgot about that one. And it is cross-platform too. OP uses the Windows API call, though. ---------------------------------------------------------------------- Jayndel · 2018-07-26 07:14 Thanks All. This is exactly what I have been looking for. Haven't coded for around 12 years & a tad rusty. Stay well.