SUMMARY 2: printing HTML on Solaris

Erwin Fritz (efritz@glja.com)
Tue, 20 Jan 1998 16:00:14 -0700

This is my second summary to my original question about printing HTML
documents on Solaris. An excerpt from my original question follows:

> What I'm shooting for is something like this. The user runs the new
> application, which produces a number of HTML files. The user then uses

> some command like:
>
> command -d printer file1.html file2.html ...
>
> (or something similar) and the files are printed on the specified
> printer. The important thing here is that the files, when printed,
look
> the same as they do in a browser window.

An excerpt from my first summary follow:

> Many people suggested Lynx. I tried that, but HTML printed in Lynx
look
> the way they appear in the Lynx screen (naturally), whereas I needed
> something which handled the various fonts and sizes associated with
the
> different HTML attributes. Basically, I need to emulate the Print
> function of either the Netscape GUI or the Internet Explorer GUI.
>
> Other people suggested html2ps. I tried that too, but it doesn't
support
> HTML tables properly, and all the HTML documents in question use
tables.
> *sigh* That was the best answer by far, however, since it was the
> closest thing to what I need.
>
> One person suggested lwprequest, a Perl program. However, that
software
> also doesn't support tables.

I received many more replies after posting the summary. Now that I have
fixed the problem, I thought I'd share it with all of you.

Adam Singer suggested I look at a product called RosettaMan (a.k.a.
Polyglot) which seems to convert files from one format to another. I
didn't get a chance to try this before I found another way.

Most people suggested I look at
http://home.netscape.com/newsref/std/x-remote.html. I did, and that's
where the answer lies. I use a command sequence like this:

netscape &
netscape -noraise -remote "openURL(file:<path>)" -remote "print()"

This works, but only on versions of Netscape prior to 4. If you try this
on Netscape 4.04, you get a pop-up dialog box where you can input your
printer configuration. Naturally, that's no good in a batch script.

Thanks go to blackman@voicenet.com, Ray Browning, Stephen Harris, Dan
Pritts, Anthony Worrall, Shriman Gurung, M. Hawkins, Ryan Clutter, and
especially to Rachel Polanski for her many correspondences.

Erwin Fritz
UNIX/NT/LAN Guy
Gilbert Laustsen Jung Associates Ltd.
http://www.glja.com