Link to home
Start Free TrialLog in
Avatar of madhurikg
madhurikg

asked on

How to print a HTML file in unix using a command?

Hi,

  I need to print html files in unix using a command. The print out should not have any html tags and it should look like what we see in browser.
 The command should be executed in back ground so that i can use this command in my java program for html prints.

  On windows XP we can right click a file and send it to a printer,windows automatically converts that and prints the page.

  I am looking something similar in unix using a command.

  Does any body know any command.

 ***It is urgent****

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Nukfror
Nukfror
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ahhh !!! Maybe even better.  If you take a look here:

http://www.blastwave.org/packages/htmldoc

You'll see blastwave has the HtmlDoc package.  The htmldoc page makes this thing look pretty nice !!

http://www.htmldoc.org/

"HTMLDOC converts Hyper-Text Markup Language ("HTML") input files into indexed HTML, Adobe® PostScript®, or Adobe Portable Document Format ("PDF") files.

HTMLDOC supports most HTML 3.2 elements, some HTML 4.0 elements, and can generate title and table of contents pages. The 1.8.x releases do not support stylesheets.

HTMLDOC can be used as a standalone application, in a batch document processing environment, or as a web-based report generation application."

So similar concept as html2ps but using htmldoc instead.
Avatar of anumalas
anumalas

Hi

If you are having mozilla installed on your mechine  you can print with that command

to invoke mozilla command line simply type

$mozilla and to search the print optings $mozilla -help

Use mozilla  and lpr to print html content. I did not get exact command to give

Hope this will help :)
check the bellow script

test.sh

//First export the mozilla environment..

$Filename= "yourfilename";
mozilla -browser  & $Filename; //check the syntax to run mozilla in background;
lpr -d<printername>; // there is no need to specify filename;
// write a code to get mozilla's process id using ps
kill -9 <pid of mozilla>; //if you will not kill mozilla it will run in background continiously

Its just a trail chek and implement script