[comp.unix.questions] how to print with troff on a UNIX pc?

srh@docwrk.UUCP (Steven R. Houser) (10/10/90)

I'm trying to print files with troff on a UNIX pc with v. 3.51 UNIX.  I
have a Hewlett-Packard DeskJet connected to the machine.  When I used
nroff, I just piped the output to lp.  But when I print troff files from ua
or pipe them to lp, the DeskJet just prints raw troff output like this:

x T post
x res 720 1 1
x init
V0
p1
x font 1 R
x font 2 I
x font 3 B
x font 4 BI
x font 5 CO
x font 6 H
x font 7 HI
x font 8 HB
x font 9 S1
x font 10 S
s10
f1
H720
V480
h4270c1

Why does my printer just print this instead of interpreting it?  Do I
need to pipe it to another device?  Or doesn't the DeskJet understand
trofftroff?  The DeskJet is supposed to be LaserJet compatible.  I have my
ua printer setup configured for the LaserJet, and never had any problem
printing nroff on it.

Steve 
-- 
==========================================================================
Steven R. Houser    The Document Workshop  |  "No man but a blockhead ever
uunet!osu-cis!n8emr!oink!docwrk!srh        |   wrote except for money."
CompuServe 76004,3212                      |                Samuel Johnson  

gwyn@smoke.BRL.MIL (Doug Gwyn) (10/12/90)

In article <74@docwrk.UUCP> srh@docwrk.UUCP (Steven R. Houser) writes:
>x T post
>Why does my printer just print this instead of interpreting it?

Why shouldn't your printer print text files sent to it?
You're asking the wrong question.  If you referred to the Documenter's
WorkBench manuals before trying to use the Documenter's WorkBench
software, you would have known that the output from troff must be
postprocessed by a device-specific utility.  I note that you told
troff to use the font information for device "post", which I assume
is some sort of PostScript device.  While any troff postprocessor is
supposed to be able to handle troff output that was prepared for any
device, the font usage will be suboptimal unless the device specified
to troff matches the one that will be used to display the output, and
many troff postprocessors do not properly handle mismatched devices,
fonts, etc.  (While that's a bug, it's a common fact of real life.)

Troff postprocessors for H-P LaserJets are available from a variety
of sources, for example Elan Computer Group's EROFF package.

There is much more that could be said about the care and feeding of
LaserJets in a UNIX environment, but you really need a resident guru.

mhw@fithp.uucp (Marc Weinstein) (10/20/90)

From article <74@docwrk.UUCP>, by srh@docwrk.UUCP (Steven R. Houser):
> have a Hewlett-Packard DeskJet connected to the machine.  When I used
> nroff, I just piped the output to lp.  But when I print troff files from ua
> or pipe them to lp, the DeskJet just prints raw troff output like this:
> 
> x T post
> ...
> 
> Why does my printer just print this instead of interpreting it?  Do I
> need to pipe it to another device?  Or doesn't the DeskJet understand
> trofftroff?

I'm not a troff expert, but troff itself produces fairly "unprintable"
output, as opposed to nroff which creates pretty much ASCII output.
In other words, troff output doesn't usually resemble the text you desire.
My understanding is that troff output needs to be piped through a
translator which knows your printer's language.  I recently bought a
HP Laserjet IIp and plan to use Device-Independent Troff (ditroff)
piped through a package called Jetroff, which converts the troff
output to Laserjet language.  Jetroff comes with a set of downloadable
fonts and knows HP's proprietary printer language, so it can select
fonts, set line spacing, do bold/italics, etc.  I've also heard that
the new groff supports Laserjets as well.

The OSU archives may have copies of these...

Marc Weinstein