A while ago I asked for a tool to automate generation of postscript files from
HTML files, possibly with the same look of ps files created by NCSA X-Mosaic,
and very very desirably as a precompiled Alpha executable.
I received two answers, found another possibility searching Web archives, ...
and finally implemented a different adhoc solution. I summarize for those
interested.
1) From: Olle Eriksson <olle_at_cb.uu.se>
> Try the html2ps package, available from ftp.tdb.uu.se
This was also quoted in several Web archives. I discarded this because
it's written in perl, which I do not have installed, and because it does
not handle inlined images (according to documentation)
2) From: Kyle_Amon_at_jabil.com
> You could probably do it without too much trouble.
> First, write an SGML tag remover script to get it back to text only.
> Then get one of the available a2p.c (ascii to postscript) type
> programs out there, compile it and run it on the text only file you
> just created. Some of the converters do a better job than others,
> and you might even have to tweak the code of one (I did once) to get
> it just right (BTW, you'll never get the graphics like this -- TEXT
> ONLY). Write a script to tie it all together and you're cooking ps
> files.
Well, the very first line I could not understand.
And it will never handle inlined images.
3) This I found on the web
I can't remember where (probably at NCSA or in a site pointed from
there ... curiously enough the author is closer to me than the site ...)
>From: RUTA_at_ASIMT0.MT.ASI.IT (FRANCESCO RUTA )
>Article: 4793 of cern.www.talk
>htpscode.tar.Z
>htpsinfo.txt
I hope that the tar file name is enough for whoever is interested to
play with. Apparently it is a set of gcc programs with an impressive
(too impressive) set of options to customize fonts. It does handle
inlined images.
But I haven't gcc installed, the program was never tested on Alpha
before, and probably it is a bit of overkill.
4) My solution (semi-automatic)
99 lines of shell script, 19 of awk and 4 of sed.
Since XMosaic does already all the formatting into Postscript I want,
I took advantage of its "remote control" facility.
The script scans an index file I prepare, and for each file forces
my XMosaic to display the HTML file. Then it waits.
At this point I have to do manually :
hit Save As button
the first time select Postscript
all the times enter the file name (I use a fixed short name "z")
press return
Then the script finds the work file z there, does some awk to remove
some unwanted stuff (like the ps prologue on all files but the first)
or to change page numbering, and catenates the resulting ps "chunk" to
my final file.
Or quasi-final, since another awk file does final renumbering.
It's not automatic, pity ...
----------------------------------------------------------------------------
A member of G.ASS : Group for Astronomical Software Support
----------------------------------------------------------------------------
Lucio Chiappetti - IFCTR/CNR | Ma te' vugl' da' quost avis a ti' Orsign
via Bassini 15 - I-20133 Milano | Buttet rabios intant te se' pisnign
Internet: LUCIO_at_IFCTR.MI.CNR.IT | (Rabisch, II 46, 119-120)
----------------------------------------------------------------------------
For more info :
http://www.ifctr.mi.cnr.it/~lucio/personal.html
----------------------------------------------------------------------------
Received on Tue Jan 07 1997 - 19:36:11 NZDT