Dave Cross wrote:
Excellent idea![Dave enters this thread a little late]Strikes me that there should be some way to use Gecko to do it. That would certainly get round the problem of it understanding "modern" HTML. Most Gecko-based browsers will save a page as postscript (using "print to file" and choosing a basic postscript printer). So the problem becomes how to script that action. Netscape 4.x used to allow you to do this using the "remote" interface: netscape -noraise -remote("openFile($url)) netscape -noraise -remote("saveAS($file, 'PostScript')) but that interface doesn't seeme to be available in Netscape 7, Mozilla or Galeon. Seems an obvious use of Gecko to me, but no-one seems to have done it yet. In the absense of that, perhaps an Expect-based solution round Mozilla would be the best idea.
Expect against straight mozilla wouldn't be of much use, as there's no text to expect. But some of the supporting programs in mozilla's directory might be of use. Like xpcshell, the javascript cli. I would imagine that you could control gecko from there somehow (if you could understand mozilla's API...) and render then save as PS.
The other alternative is to produce a perl native interface to XPCOM. My mind is blowing... But it looks like somebody's already attempted it:
http://plxpcom.mozdev.org/
I will have to have a look at this again after reading the mozilla book that's just landed on my desk.
-Dom
--
| Semantico: creators of major online resources |
| URL: http://www.semantico.com/ |
| Tel: +44 (1273) 722222 |
| Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |