Recent

Author Topic: Printing in Windows XP  (Read 6652 times)

Guest

  • Guest
Printing in Windows XP
« on: February 28, 2005, 11:02:02 am »
Does anybody know how to print the lines of a TMemo in Windows Xp?

I checked the "Printers" unit and there is not an implementation of DoEnumPrinters so I tried to implement one myself using the Windows function "EnumPrinters", but I cannot figure out which unit to add to the "uses" section so that it works correctly.

I don't think it's WinApi or Windows, because I' ve tried it  and it couldn't find the function.

Anonymous

  • Guest
Printing in Windows XP
« Reply #1 on: March 18, 2005, 07:21:56 pm »
Install Printers4Lazarus pakage

Olivier

Anonymous

  • Guest
Printing in Windows XP
« Reply #2 on: May 29, 2005, 12:46:56 am »
howto install Printers4Lazarus, i download from sf.net, more not exists .lpk

matthijs

  • Hero Member
  • *****
  • Posts: 537
Printing in Windows XP
« Reply #3 on: May 29, 2005, 09:30:58 am »
1. Goto {$LazarusDir}/components/printers. You will find the Printer4lazarus package file there.
2. To print the context of a memo there are no standard methods or procedures. All you can do is put the contents of the memo on the printer canvas.
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

matthijs

  • Hero Member
  • *****
  • Posts: 537
Printing in Windows XP
« Reply #4 on: May 29, 2005, 10:21:47 am »
Putting the contents of your memo to the printer You could do something like:
Code: [Select]

begin
  Printer.BeginDoc;
  Printer.Canvas.TextOut(20, 20, 'Some line of text!')
  Printer.EndDoc;
end;

To print the next line of text find the height of the text with
Code: [Select]
Printer.Canvas.TextHeight('Gg'); and it this to the Y coordinate of the TextOut function.
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

 

TinyPortal © 2005-2018