Subject: Re: [netatalk-admins] Here is a lpd filter for landscape printing via Ghostscript
From: Ortwin Gentz (ortwin@gentz.com)
Date: Fri Sep 04 1998 - 18:54:01 EDT
On 29.11.1997 14:58 Uhr Marc Liyanage <liyanage@access.ch> wrote:
>I wrote a short Perl script that can be used as a filter for lpd
>in order to reliably rotate pages that need to printed in landscape mode.
>
>It seems to work with PostScript files generated by the Adobe PSPrint
>and Apple LaserWriter 8 printer drivers, received via papd.
>I am using it with a Stylus Color 600 printer.
>
>
>It can be found at
>
>http://www.access.ch/ml/unix/macpsfilter.pl
>
>
>
>Email me if you have problems using it or if you'd like
>to send me comments.
Your script is fine! However it didn't work with MacOS 8.1's
TCP/IP printing. The problem is that papd automatically converts
Mac-CR into UNIX-LF but the direct TCP/IP printing not.
It's not a problem for Perl because we can set the line delimiter
via the builtin variable $/. The only problem is to determine
from where the script was started. Since papd normally runs as
root the -n switch is set to root when the request came from papd.
Otherwise -n is the Mac username.
So this code pasted in at the beginning of the script does the job:
if ($ARGV[4] ne "root") {
$/="\r";
}
Have fun,
Ortwin
__________________________________
Ortwin Gentz ortwin@gentz.com
http://www.gentz.com
Public-Key:
ortwin@gentz.com">http://keys.pgp.com:11371/pks/lookup?op=get&search=ortwin@gentz.com
This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:33:14 EST