[fpc-pascal] Command line or CGI Printing

Michael Van Canneyt michael at freepascal.org
Wed Sep 15 16:10:32 CEST 2010


You can't use pipes.

lpr relies on the file extension to determine the file type and invoke the =
proper filter.

When using pipes, it assumes postscript AFAIK.

In each case creating the file doesn't hurt. LP will create a file anyway.

Michael.

On Wed, 15 Sep 2010, Leonardo M. Ram=E9 wrote:

> Nice!, and is it possible to send the bitmap data to lpr through a pipe?.
>
> Something like "cat myfile.bmp|lpr". This doesn't work, it just prints ga=
rbage, maybe "cat" is handling the file as text.
>
> I'm asking this because I don't want to create the file, then print it, t=
hen delete it, much better if I just create a TMemoryStream and send it to =
lpr.
>
> Leonardo M. Ram=E9
> http://leonardorame.blogspot.com
>
>
> --- On Wed, 9/15/10, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
>
>> From: Graeme Geldenhuys <graemeg.lists at gmail.com>
>> Subject: Re: [fpc-pascal] Command line or CGI Printing
>> To: "FPC-Pascal users discussions" <fpc-pascal at lists.freepascal.org>
>> Date: Wednesday, September 15, 2010, 10:33 AM
>> On 15 September 2010 14:20, Leonardo
>> M. Ram=E9=A0 wrote:
>> > Hi, I'm looking for a way to send images to a printer
>> without using the Printers unit. I can't use it because it
>> relies on X (on Linux) and I need to print from a CGI or
>> command line application, that must be installed on servers
>> without X installed.
>> >
>> =

>> For more details:=A0 =A0=A0=A0man lp
>> =

>> =A0=A0=A0Print a double-sided legal document to a
>> printer called "foo":
>> =A0 =A0 =A0 =A0 =A0 lp -d foo -o media=3Dlegal
>> -o sides=3Dtwo-sided-long-edge filename
>> =

>> =A0=A0=A0Print an image across 4 pages:
>> =A0 =A0 =A0 =A0 =A0=A0=A0lp -d bar -o
>> scaling=3D200 filename
>> =

>> =A0=A0=A0Print a text file with 12 characters per
>> inch, 8 lines per inch, and a
>> =A0=A0=A01 inch left margin:
>> =A0 =A0 =A0 =A0 =A0=A0=A0lp -d bar -o
>> cpi=3D12 -o lpi=3D8 -o page-left=3D72 filename
>> =

>> =A0=A0=A0Or just print the file to the default
>> printer
>> =A0 =A0 =A0 =A0 =A0=A0=A0lp "my long
>> file.txt"
>> =

>> =

>> =

>> -- =

>> Regards,
>> =A0 - Graeme -
>> =

>> =

>> _______________________________________________
>> fpGUI - a cross-platform Free Pascal GUI toolkit
>> http://opensoft.homeip.net/fpgui/
>> _______________________________________________
>> fpc-pascal maillist=A0 -=A0 fpc-pascal at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


More information about the fpc-pascal mailing list