• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing HTML document  RSS feed

 
Ambika Kumar J
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai.,

I want to print an html page directly from my application. It should not show the html page. If I click on some button, directly it should print y html document.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's tricky. You need a component that can render HTML to do that, and there are few of those around. JEditorPane can render HTML 3.2 (no CSS), but it may be possible to get it to print without actually showing it on the screen.

Another possibility might be to use the OpenOffice Java API. OO can open (some?) HTML files, and in server mode it doesn't show a GUI, so you can instruct it to print the open document.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!