Hello,
i need to be able to print HTML. Right now, i'm using a JEditorPane with
a modified version of this:
PrintUtilities class
http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-Printing.html
but the problem is that page breaks happens in middle of image or text
line. So i must find a better way. I've found these:
Start of a complete formatting framework, too much things to
add/correct/understand:
http://www.javaworld.com/javaworld/jw-10-2000/jw-1020-print.html
Some tools to show/print HTML, in last resort
http://mindprod.com/jgloss/htmlrendering.html
Is there any simple way to correct the page break problem?
TIA
Thomas Weidenfeller - 23 Aug 2006 16:41 GMT
> Is there any simple way to correct the page break problem?
No, there isn't. You would need to obtain or write an HTML renderer
which does proper pagination. The problem with HTML is that it doesn't
provide hints about where page breaks should be, since HTML has the
notation of a single page only. Any renderer therefore has to guess. And
has to overcome obstacles like very wide lines, since there is no
horizontal scrollbar on a printed page ;-)
Further, you will have some fun with Java's printing system which can
drive people insane.
You could try if you could make Apache FOP work for you
http://xmlgraphics.apache.org/fop/ However, they also recommend not to
start with HTML.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/