[lazarus] Printers unit

Tony Maro tony at maro.net
Tue Nov 5 16:15:07 EST 2002


On Tue, 2002-11-05 at 08:56, Michael Van Canneyt wrote:
> 
> Use the TProcess object of the FCL:
> 
> With TProcess.Create(Self) do
>   Try
>     CommandLine:='/usr/bin/lpr -PPrintterName');
>     options:=[poUsePipes];
>     Execute;
>     With InputStream do
>       begin
>       // Write postscript to stream.
>       end;
>   finally
>     Free;
>   end;
> 

I can't seem to get the stream to work quite right (it's "Input" by the
way and not "InputStream"

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






More information about the Lazarus mailing list