Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Printer sample code ?

I have a graphics routine that paints on a form's  canvas.
Now I try for the first time to print this on paper.
I know, In general, it should be easy, 
using TLMDPrinter and redirecting to its Canvas
between BeginDoc and EndDoc commands.
But all of this fails,
so my question;
Is there any sample code for printing and selecting a printer ?
Sorry, the scarse info in the LMD Tools help files is not helpful
for a beginner like me.
Thanks for your feedback !!!
Michael

Comments

  • 1 Comment sorted by Votes Date Added
  • TLMDPrinter is designer to work with predefined in LMD-Print package print tasks. Pure graphics can be printed with standard Delphi TPrinter. LMD components can only make selecting the printer more easy:

    var
      p: TPrinter;
    begin
      if LMDPrinterSetupDialog1.Execute then
      begin
        p := LMDPrinter1.GetSysPrinter;
        p.BeginDoc;
        p.Canvas.Rectangle(50, 50, 300, 300);
        p.EndDoc;
      end;
    end;
Sign In or Register to comment.