[lazarus] Printers unit

Tony Maro tony at maro.net
Wed Nov 6 23:23:11 EST 2002


Well, nobody has complained yet about small attachments so here:

Another working printing example.  I did as requested and separated the
TPostScript object from the printing system completely.  It still uses a
TPostScriptCanvas for individual pages, to keep a similarity to the
standard Delphi printing system so that it will interact more smoothly
with it.

So far it supports text with fonts and sizes, color, fills, rectangles,
ellipses, lines and pies.  Stretching ellipses and pies was hard work,
BTW.

I then hacked together a TPrinter object that calls it.  The hacked
TPrinter will print to postscript file, print to printer or print to
PDF.  In OS's other than Linux all you get is print to postscript file.

Here's my next question:  I've no experience with TPen or TBrush and I
wonder if I need to use them to standardize the color selection
methods.  However, I won't be supporting bitmaps yet, so TBrush may be
the wrong thing...

Do you think it needs to use the standard TPen and TBrush objects, or do
you think my current approach of a FillColor and PenColor property will
be fine?  I do need a Pattern property, but it will be postscript code,
not bitmap, most likely.  I'm having problems figuring out embedding
bitmaps.  But, considering I've only really been doing Postscript for
about a week now, I guess this isn't bad.

Also, I still haven't figured out the question below:

On Tue, 2002-11-05 at 15:23, Tony Maro wrote:

> I can't seem to get the stream to work quite right
> 
> With TProcess.Create(nil) do
>   Try
>      writeln('Setting LPR command');
>      CommandLine:='/usr/bin/lpr'; 
>      options:=[poUsePipes];
>      Execute;
>      FPostScript.Document.SaveToStream(Input);
> 
>   finally
>      Free;
>   end;
> 
> But nothing ever happens.  I can call this by saving to a file first and
> then passing the path to that to lpr in the commandline param above, but
> not if I try to stream it.
> 
> What am I doing wrong?
> 
> Thanks,
> Tony
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives
-- 
Tony Maro
tony at maro.net
http://tony.maro.net/

ERROR !
A serious problem has been detected in your Windows operating system! 
Please insert Linux-Mandrake Installation CD and click REBOOT to resolve
this problem.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gz00002.gz
Type: application/octet-stream
Size: 10087 bytes
Desc: "printer.tgz"
Url : http://localhost/pipermail/lazarus/attachments/20021106/5b7110f1/gz00002.obj


More information about the Lazarus mailing list