File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes printing XHTML document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "printing XHTML document" Watch "printing XHTML document" New topic

printing XHTML document

Bhavin Sanghani
Ranch Hand

Joined: Dec 17, 2003
Posts: 67
i want to print no. of xhtml documents in one shot as we can see in browser using java code.
which class i can use ? anybody can give sample code?
VJ Silva

Joined: Sep 02, 2003
Posts: 5
Hey... Maybe this can be answered better in the intermediate or advanced forums... Good luck...
Vijay Silva.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, Bhavin!
I'm not exactly sure I understand your question. Are you asking about how to print an xthml document from Java, so that the printed page appears as a web browser, such as Internet Explorer, would interpret it?
To start to get familiar with Java's printing API, you might want to take a look at a 5 part series of articles on printing in Java by Jean-Pierre Dub´┐Ż at JavaWorld.
  • Part 1
  • Part 2
  • Part 3
  • Part 4
  • Part 5

  • Note that JEditorPane can interpret and display HTML documents, but I've read that it only supports HTML up to version 3.2 and it doesn't interpret XHTML correctly. I've noticed a couple of commercial APIs for Java that can handle XHTML correctly, including one from grand-rapid developers.
    Perhaps someone over in the Swing / JFC / AWT forum has some ideas. I'm moving this thread there now...
    [ December 21, 2003: Message edited by: Dirk Schreckmann ]

    [How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
    I agree. Here's the link:
    subject: printing XHTML document
    It's not a secret anymore!