Apsfilter and margins...

Malcolm Kay malcolm.kay at internode.on.net
Thu Feb 19 06:56:46 PST 2004


On Wed, 18 Feb 2004 02:18, Eric F Crist wrote:
> -----Original Message-----
> From: Malcolm Kay [mailto:malcolm.kay at internode.on.net]
> Sent: Tuesday, February 17, 2004 9:27 AM
> To: ecrist at 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 the
> >
> > 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=/var/spool/lpd/raw1440:\
        :if=/usr/local/libexec/lpd/raw1440:\
        :mx#0:\
        :sh:\
        :lp=:\
        :rm=hl1440:\
        :lf=/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="" read -r first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then
    #
    #  It is PostScript; use Ghostscript to scan-convert and print it.
    #
    /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=hl1250 -r300 \
        -sOutputFile=- - && 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 printer
or Apsfilter.

Malcolm




More information about the freebsd-questions mailing list