Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jan 1999 18:48:06 +0000
From:      Mark Ovens <marko@uk.radan.com>
To:        cjclark@home.com
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Manpage to PS and Printer Control
Message-ID:  <369F8D66.2061ADEB@uk.radan.com>
References:  <199901151734.MAA00481@cc942873-a.ewndsr1.nj.home.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"Crist J. Clark" wrote:
> 
> I know I've seen this a zillion times, but when you want to actually
> do it, you can never figure it out or find the reference...
> 
> I want to convert some manpages to PostScript for printing. I thought
> it would be as easy as,
> 
> % gunzip -c /usr/local/man/cat1/<command>.gz | groff | lpr
> 
> However, I wrote to a test file first rather than to the printer. I
> took a look with ghostview and the ps file is really messed up. It's
> obviously the right file, but weird stuff going on.
> 
> As an aside, I tried to print the man pages with just,
> 
> % man <command> | lpr
> 
> And the output looks pretty good (underlines in place, etc.), but for
> some reason my printer likes doing it in landscape. My printcap for
> the printer (an HP PostScript printer with JetDirect card) is just,
> 
> lp|hall:\
>         :sh:\
>         :rm=hall:rp=raw:\
>         :sd=/var/spool/output/hall:lf=/var/log/lpd-errs:\
>         :if=/usr/local/libexec/hpif:
>

PS printers should print ASCII text. If there's not the PostScript
header in the file they just interpret it as text. As for landscape,
check the default settings on the printer itself. Maybe they're set to
landscape (a PS file will have the orientation in it, so PS files will
come out correctly)

> And the hpif is just a filter from the handbook that prevents HPs from
> stair-stepping,
> 
> #!/bin/sh
> #
> # hpif - Simple text input filter for lpd for HP-PCL based printers
> # Installed in /usr/local/libexec/hpif
> #
> # Simply copies stdin to stdout.  Ignores all filter arguments.
> # Tells printer to treat LF as CR+LF. Writes a form feed character
> # after printing job.
> 
> printf "\033&k2G" && cat && printf "\f" && exit 0
> exit 2
> 
> Anyone help with that?
> 
> I'd really appreciate help on manual pages to PostScript. Figuring out
> my printer problem would just be a bonus. ;)

check out a2ps in the ports.

FWIW, on my Sun I have the following alias

alias pman 'man \!* | /usr/5bin/pr -t -f -o8 | lpr -h'

that formats manpages nicely (puts the page breaks in the right place,
where the footers are). /usr/5bin is the directory which holds SYSV
versions of commands on a Sun. I use that version of pr(1) as it allows
you to indent the page (-o 8) so that if you punch ring binder holes in
the printout you don't punch through text. I don't know if you can make
use of that on FreeBSD as I don't have a printer.

> --
> Crist J. Clark                           cjclark@home.com
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

-- 
  Trust the computer industry to shorten Year 2000 to Y2K. It
  was this thinking that caused the problem in the first place.

      FreeBSD - The Power To Serve http://www.freebsd.org
      My Webpage http://www.users.globalnet.co.uk/~markov
_______________________________________________________________
Mark Ovens, CNC Apps Engineer, Radan Computational Ltd. Bath UK
CAD/CAM solutions for Sheetmetal Working Industry
mailto:marko@uk.radan.com                  http://www.radan.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?369F8D66.2061ADEB>