views:

398

answers:

1

I need to print a an html out to the printer programmatically. I do not want to print the html tags, I want the html tags parsed before printed.

This code adds html features and data to an htm document named document. I am then sending the output to a file named itext.html

HtmlWriter writer2 = HtmlWriter.getInstance(document,new FileOutputStream("itext.html"));

I know need to somehow parse that html file and print it without having to open it up in a browser and going to FILE and Print.

+2  A: 

Cobra will render HTML to a Swing-compatible panel. You should be able to print that using the standard Print APIs/services.

Brian Agnew
I dont want to get swing components involved because I do not like the quality of the printouts. It would be better if I just print text. I have the html documents prepared using the itext library. I just need a way to print the view(how it would appear in a brower) of the document programmatically without making the users of my application have to open the html file in the browser and printing it from there, this would be my last option if anything else is not possible.
manuel