[lazarus] How do I approach printing?

Andrew Johnson aj_genius at hotmail.com
Fri Oct 4 10:35:45 EDT 2002


On Thu, 3 Oct 2002 22:30:20 -0500
"Tony Maro" <TonyM at nlisc.com> wrote:

>I noticed there is not TPrinter object yet...

>What's the best way for me to approach Linux CUPS printing?  Or even just 
>print to postscript file would make me happy.

there is no way yet.. I have plans to make some, but they are long term 
because of the complexity involved. I would suggest looking to see if there 
are any Delphi/Kylix Postscript producers to port, otherwise...you'll 
probably have to write your own.

Basically if you are dealing with simple enough stuff.. aka lines rectangles 
and text. You can produce PDF's without much hastle, and then call to 
external programs to print it. The bulk of the problem is the Fonts and 
header info. but the actual calls are relatively simple. I would suggest 
taking a look at some Delphi wrappers for this sort of thing. There are a 
few at Torry.net I saw. Try looking at TNPDF and vPDFCreator. These are 
mostly portable to Kylix, so they should probably be portable enough to 
Lazarus, that you could use them as a basic framework for simple printing. 
They are not very well thought out IMO, and are somewhat sloppy coding. but 
they still should be useable enough, if you are willing to sit down and 
study the code enough that you can see what it is they do. I may be able to 
write a simple PDFCanvas with support for basics myself, based on these two 
packages, but it may take awhile as I am rather busy at the moment.

Andrew

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com






More information about the Lazarus mailing list