Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Im trying to print html docs from unix but im just getting the raw text with all the tags and such, i need it look like it does in netscape. Ill even try converting html to jpg or something to accomplish this. Im running Solaris 7. thanks!

Well, you CAN get Netscape & even Internet Explorer for most Unix OSes, however a simpler approach is to just use the html2rtf tool which is probably lurking somewhere on you system allready. Note: you may have to prefilter the document with dos2unix - another command line utility that strips off the end-of-line coding unique to text documents created in DOS/Windows text. Basic command line entry would probably be
yourfile.txt | dos2unix | html2rtf > lpr
Beaker

I forgot to say i need to print from the command line ONLY. The above reply didnt work at all, unix lpr or lp does not understand rtf files either and your example talks about a text file, im using an html file.
thanks

In UNIX nearly all files are text files.
there is yet another utility called "rtf2txt" - see a pattern here ? - that will do the rtf to text conversion. Just slip it into the command line pipe previously posted.
"lp/lpr" are the common designator for a UNIX printer. Yours could be different. Also, if you're looking to retain the formating - ie pretty fonts of differnt sizes - you'll likely need to utilize "ghostscript" or a similar postscript-emulator for your print job.

Dude i dont think you understand my prob. I have an html file, a web page, i am trying to print it with all the pretty formatting, frames fonts and such. Why would i use a rtf2text or html2rtf?!?!? then i lose all my pretty formatting. I am using lp or lpr it doesnt matter to me. I am a unix expert but this is not an easy task. If i open it in the netscape gui and print it its fine but i need to script this into my scripts. if netscape can do it i know it can be done, someone told me to try getting an html printer filter for lp but i cant find one.
How would converting it to rtf be any help at all?!?!?!

You need html2ps.
I'm trying to get it to work on my system right now. I can print out the HTML file to a postscript printer, but the images do not show up. You'll need ImageMagick or some similar program for that.
I'm having trouble getting html2ps to recognize that ImageMagick is installed for the graphic problem.
Good Luck!

hi ya'll
I have the same problem too.
I have more than 500 pages to be printed in html format, will frame, text align and everything. I need to know if there a script which will send pip netscape printing proccess to the printer. Will someone help me,,,,?www.aznblood.net

The page for html2ps is http://www.tdb.uu.se/~jan/html2ps.html
Once you have it in postscript you *should* be able to create a postscript file using
html2ps file.html > newfile
Then you can print the new file.
Not sure how successful it will be, though -- if you consider how differently browsers interpret HTML... ;-o
Sean

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |