Solved

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

Posted on 2006-06-19
6
242 Views
Last Modified: 2013-12-27
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
0
Comment
Question by:madhurikg
  • 2
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
Nukfror earned 500 total points
ID: 16935584
You might considering using html2ps:

http://user.it.uu.se/~jan/html2ps.html

and then print the result Postscript document to the print assuming your printer is PS ready.
0
 
LVL 10

Expert Comment

by:Nukfror
ID: 16935661
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.
0
 
LVL 3

Expert Comment

by:anumalas
ID: 17097414
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 :)
0
 
LVL 3

Expert Comment

by:anumalas
ID: 17097489
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

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now