>>>>> "Bhuvaneswari" == Bhuvaneswari Palanivel <[EMAIL PROTECTED]>
>writes:
Bhuvaneswari> Hi,
Bhuvaneswari> For my application, we need to print many HTML pages. How can i print
HTML
Bhuvaneswari> pages without using the Graphics object? Actually in java 1.2 contains
Bhuvaneswari> Printing API. But the interfaces and classes are used for painting
images
Bhuvaneswari> and text.
Bhuvaneswari> Please give some information regarding on this.
Bhuvaneswari> If possible, some sample code.
If you load your HTML into a JEditorPane, it knows how to render it on
the screen. You can derive a class from JEditorPane that implements
Printable, and add a "print" method, which will just call "paint()",
sending the Graphics2D object. Other details, like scaling, are
relevant, but are just fine-tuning compared to getting the page to
print at all.
I've done this with a JEditorPane I display on the screen. It's
entirely possible you could get this to work without rendering it on
the screen.
Trying to print multiple HTML pages like this (in an unattended
fashion) might be difficult. I'm not sure what issues might surface.
--
===============================================================================
David M. Karr ; [EMAIL PROTECTED] ; w:(425)487-8312 ; TCSI & Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (#12004)
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets