Solved

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

Posted on 2006-06-19
6
241 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 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

21 Experts available now in Live!

Get 1:1 Help Now