Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Feb 2004 01:26:39 +1030
From:      Malcolm Kay <malcolm.kay@internode.on.net>
To:        "Eric F Crist" <ecrist@adtechintegrated.com>, "'FreeBSD questions List'" <freebsd-questions@freebsd.org>
Subject:   Re: Apsfilter and margins...
Message-ID:  <200402200045.04496.malcolm.kay@internode.on.net>
In-Reply-To: <004a01c3f56d$86c9ac30$6401a8c0@Nomad>
References:  <004a01c3f56d$86c9ac30$6401a8c0@Nomad>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 18 Feb 2004 02:18, Eric F Crist wrote:
> -----Original Message-----
> From: Malcolm Kay [mailto:malcolm.kay@internode.on.net]
> Sent: Tuesday, February 17, 2004 9:27 AM
> To: ecrist@adtechintegrated.com; FreeBSD questions List
> Subject: Re: Apsfilter and margins...
>
> On Tue, 17 Feb 2004 02:33, Eric F Crist wrote:
> > Hello list,
> >
> > Does anyone here use apsfilter?  If so, can you tell me how to fix th=
e
> >
> > margins.  There is NO bottom margin (text runs off bottom of the page=
)
> >
> > and the top margin is about 2 inches.  Any idea on how to change this=
?
>
> No information about your circumstances -- printer make/model -- what
> sort of files you are passing to it.
>
> This is sometimes a printer adjustment. Have you read the printer
> manual?
>
> Malcolm Kay
>
>
> Malcolm,
>
> I've got Brother HL-1440 laser printer.  I throw all kinds of files to
> it.  Everything from text via command line (i.e. lpr /etc/rc.conf) to
> openoffice documents to webpages from Konquror or Firebird.
>
> Yes, I've read the printer manual.
>
> Eric F Crist

At work I have an HL1440 shared as a network printer.
I don't use Apsfilter.

It works fine with plain-text, postscript or PCL.
The printcap entry:

hl1440|raw1440|Brother HL1440:\
        :sd=3D/var/spool/lpd/raw1440:\
        :if=3D/usr/local/libexec/lpd/raw1440:\
        :mx#0:\
        :sh:\
        :lp=3D:\
        :rm=3Dhl1440:\
        :lf=3D/var/log/lpd-errs:

And /usr/local/libexec/lpd/raw1440:
#!/bin/sh
#
#  Treat LF as CR+LF:
#
printf "\033&k2G" || exit 2

#
#  Read first two characters of the file
#
IFS=3D"" read -r first_line
first_two_chars=3D`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" =3D "%!" ]; then
    #
    #  It is PostScript; use Ghostscript to scan-convert and print it.
    #
    /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=3Dhl1250 -r300 \
        -sOutputFile=3D- - && exit 0
else
    #
    #  Plain text or PCL, so just print it directly; print a form feed
    #  at the end to eject the last page.
    #
    echo "$first_line" && cat && printf "\033&l0H" && exit 0
fi

exit 2
-------------------------------------------------------------------------=
------------------------------

Suggest you check what ghostscript DEVICE Apsfilter is using -- hl1250
seems to be a good choice.

Other than that you could set up something similar to the above as an
alternative printcap entry to test out your printer while bypassing
Apsfilter -- should at least resolve whether the problem is with the prin=
ter
or Apsfilter.

Malcolm




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402200045.04496.malcolm.kay>