Printing Man pages

Printing Man pages

Post by Olivier Lacou » Wed, 18 Mar 1998 04:00:00



Hi,

I'd like to print man pages on a workstation running HP-UX with CDE but I
have not succeeded yet.
An important element is that our man pages have been processed by nroff
then compressed (they are now stored in ..../man/catn.Z directories) using
catman.

I've tried to print these pages several ways:
        using the print button of the man page viewer. It sends garbage to our
printer.
        using the zcat command. Garbage too.
        retrieving the orginal man page, pipe it to "nroff -Tlj" and printing it.
Garbage...

We have a Lexmark Optra printer which understands both postscript and PCL.

I have no other idea and I'd greatly appreciate some help.

 
 
 

Printing Man pages

Post by Mark MacLenn » Wed, 18 Mar 1998 04:00:00



Quote:> I just do 'man foo | lp' -- the paging may not be exactly what you want,
> though..

if you use 'man foo | col | ul -t dumb | lp' the printed manual pages
will look *much* nicer ...
(in fact, you could even create an shell alias for this command and
then never have to remember it)

if you have a PCL3 or later printer then you could use nroff to
properly format the manual page for printing:

   zcat < /usr/share/man/man1.Z/ls.1 | nroff -man -Tlj | lp

Alternatively, you could use the GNU groff program will create postscript
output.

- MARK

 
 
 

Printing Man pages

Post by Richard J. Rauenza » Wed, 18 Mar 1998 04:00:00


I just do 'man foo | lp' -- the paging may not be exactly what you want,
though..

Rich
--

Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave.
Development Alliances Lab|              not HP |                MS 46TU2
IASD / Enterprise Systems Group +--------------+---- Cupertino, CA 95014

 
 
 

Printing Man pages

Post by Fred Su » Wed, 18 Mar 1998 04:00:00



Quote:> I'd like to print man pages on a workstation running HP-UX with CDE but I
> have not succeeded yet.
> I've tried to print these pages several ways:
>    using the print button of the man page viewer. It sends garbage to our
> printer.
>    using the zcat command. Garbage too.
>    retrieving the orginal man page, pipe it to "nroff -Tlj" and printing it.
> Garbage...

What sort of garbage do you get?  If it's the text you want intermingled with
lots of ^H characters (so as to achieve an "overstrike" effect on ancient
hardware), you can strip all that stuff out by filtering with the (somewhat
obscure) `col' command, like this:

   man anytopic | col -b

At least then you have just plain-text to deal with.  I hope that helps you
out a bit, at least!

Fred Surr
Melbourne

 
 
 

Printing Man pages

Post by Christian Koll » Thu, 19 Mar 1998 04:00:00


On Solaris, you can use "man -t foo". then man page while be printed on the default
printer using postscript modus.

On DG/UX, i use "man -Tlp | lp". "-Tlp" indiquate that escape sequenses for the
terminal type "lp" must be generated.

You will probably have something like this on our HP/UX.

good luke

Christian

Olivier Lacour a crit:

Quote:> Hi,

> I'd like to print man pages on a workstation running HP-UX with CDE but I
> have not succeeded yet.
> An important element is that our man pages have been processed by nroff
> then compressed (they are now stored in ..../man/catn.Z directories) using
> catman.

> I've tried to print these pages several ways:
>         using the print button of the man page viewer. It sends garbage to our
> printer.
>         using the zcat command. Garbage too.
>         retrieving the orginal man page, pipe it to "nroff -Tlj" and printing it.
> Garbage...

> We have a Lexmark Optra printer which understands both postscript and PCL.

> I have no other idea and I'd greatly appreciate some help.

 
 
 

Printing Man pages

Post by Art D'Ada » Thu, 19 Mar 1998 04:00:00


On 17 Mar 1998 13:45:31 GMT, "Olivier Lacour"


>Hi,

>I'd like to print man pages on a workstation running HP-UX with CDE but I
>have not succeeded yet.
>An important element is that our man pages have been processed by nroff
>then compressed (they are now stored in ..../man/catn.Z directories) using
>catman.

>I've tried to print these pages several ways:
>    using the print button of the man page viewer. It sends garbage to our
>printer.
>    using the zcat command. Garbage too.
>    retrieving the orginal man page, pipe it to "nroff -Tlj" and printing it.
>Garbage...

>We have a Lexmark Optra printer which understands both postscript and PCL.

>I have no other idea and I'd greatly appreciate some help.

This is probably what you want.

-- How do I print/format/save a unix manual page as a plain file?
   Type
        man (command) | col -b | ssp | unexpand -a > (output-file)
   - Explaination of command
        "col -b" eliminates backspacing
        "ssp" removes multiple line-feeds
        "unexpand -a" changes spaces to tabs, when poassible

These two are useful, too

-- Displaying unix manual page without the formatting characters
   Type
        nroff -man <file-name> | pg
   where <file-name> is full pathname to man file. For example,
        nroff -man /usr/share/man/man1/glance.1 | pg

-- how to print or display a raw, uncompressed manual file
 Type
        nroff -man <filename>

 
 
 

Printing Man pages

Post by Richard J. Rauenza » Thu, 19 Mar 1998 04:00:00



>    using the zcat command. Garbage too.
>    retrieving the orginal man page, pipe it to "nroff -Tlj" and printing it.
>Garbage...

How about 'nroff -man -Tlj manpage.n | lp' ?

Rich
--

Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave.
Development Alliances Lab|              not HP |                MS 46TU2
IASD / Enterprise Systems Group +--------------+---- Cupertino, CA 95014

 
 
 

Printing Man pages

Post by Lawson Hans » Thu, 19 Mar 1998 04:00:00



Quote:> I'd like to print man pages on a workstation running HP-UX with CDE but I
> have not succeeded yet.
> I've tried to print these pages several ways:
>    using the print button of the man page viewer. It sends garbage to our
> printer.
>    using the zcat command. Garbage too.
>    retrieving the orginal man page, pipe it to "nroff -Tlj" and printing it.
> Garbage...

Here is a short shell script that may help.
It uses "man" to format the man-page, and then
uses "cat" and "col" to simplify the output
(by removing multiple blank lines, and replacing
tabs with spaces, and removing backspaces, etc.)
and then saves the result in a file named the
same as the command, with a ".man" suffix.

So if you were to type:

    manner cat

you would end up with a "cat.man" file which
you may choose to edit to remove the page break
header/trailer lines before you print using "lp"
or "lpr", or "mpage", or whatever you use to print.

#-----8<-----Cut Here-----8-----
#!/bin/sh
#
# Program:
#   manner
#
# Author:
#   Lawson Hanson
#
# Purpose:
#   Formats a "man-page" into a file "${command-name}.man"
#   having no TABS, multiple blank lines, or backspaces.
#
# Usage:
#   manner [section] command-name
#
usage()
{
    echo
    echo "Usage: manner [section] command"
    echo

Quote:}

if [ $# -lt 1 ]
then
    usage
    exit 1
fi

case $# in
    1)
        section=1
        command=$1
        ;;

    2)
        section=$1
        command=$2
        ;;

    *)
        usage
        exit 2
        ;;
esac

# The "cat -s" squeezes out multiple blank lines, and
# the "col -bh" gets rid of the backspaces, and
# suppresses the conversion of white space to tabs.
#
man -S${section} ${command} | col -bh | cat -s > ${command}.man

#-----8<-----Cut Here-----8-----

Around here we use Tom Christiansen's Perl version of "man" which
has a "-S" option for specifying the section, so from memory older
versions of "man" may use a different way to specify that.

I hope that may help.

Best regards,

Lawson Hanson

 
 
 

Printing Man pages

Post by Will Mor » Thu, 19 Mar 1998 04:00:00


maybe

          man foo | col -b | lp

would be better WRT the paging.

Will



>I just do 'man foo | lp' -- the paging may not be exactly what you want,
>though..

>Rich
>--

>Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave.
>Development Alliances Lab|              not HP |                MS 46TU2
>IASD / Enterprise Systems Group +--------------+---- Cupertino, CA 95014

--
# Copyright 1998 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
#
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas

#
#   These are my views and do not necessarly reflect anyone else.
 
 
 

Printing Man pages

Post by lvir.. » Fri, 20 Mar 1998 04:00:00



:On Solaris, you can use "man -t foo". then man page while be printed on
:the default
:printer using postscript modus.

However, when I use lpr or lp on Solaris 2.6, I get either my output
printed on the wrong paper tray (we use colored paper for banner pages
to make distribution easier) or I get text truncated.  It baffles me
as to why we are having so many printing problems.
--

<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.

 
 
 

Printing Man pages

Post by John Pea » Sat, 21 Mar 1998 04:00:00


man blah | col -b | lp


|>Hi,
|>
|>I'd like to print man pages on a workstation running HP-UX with CDE but I
|>have not succeeded yet.
|>An important element is that our man pages have been processed by nroff
|>then compressed (they are now stored in ..../man/catn.Z directories) using
|>catman.
|>
|>I've tried to print these pages several ways:
|>   using the print button of the man page viewer. It sends garbage to our
|>printer.
|>   using the zcat command. Garbage too.
|>   retrieving the orginal man page, pipe it to "nroff -Tlj" and printing it.
|>Garbage...
|>
|>We have a Lexmark Optra printer which understands both postscript and PCL.
|>
|>I have no other idea and I'd greatly appreciate some help.
|>
|>

--
John Peach, Shell Services International,
1 Altens Farm Road, Aberdeen, AB12 3FY, Scotland.


 
 
 

1. printing man pages

Can anyone tell me how to print a man page?  I think I recall having to
do this with enscript, but I don't have that available on the system.
Anyone know how else I can do this.  Thanks!

2. tcsh. why so slow?

3. Printing man pages

4. statvfs hang

5. printing Man pages?

6. Limit the ports that a given user can bind to

7. Prob. printing Man Pages from Answerbook

8. Running Java application on the Linux server

9. How to Print Man page

10. Are there any printed man pages?

11. Printing Man Pages

12. How to print MAN pages formatted to 66 lines?

13. How to print man pages