?
Solved

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

Posted on 2006-06-19
6
Medium Priority
?
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
Nukfror earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

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