Hi,

I'm able to convert a long JTextPane that combines text with embedded
components (like JFreeCharts and my own components within JPanels) into a
multi-page pdf document.  It works pretty well.

I was wondering if I should be able to convert the same JTextPane into an
html document using iText.  I realize that html conversion isn't a priority
with iText, but I was curious to see whether it worked, and what the output
would look like.


To create pdf from swing, I'm doing something like this, where I'm inside of
a class that extends JTextPane...

  PdfWriter writer = PdfWriter.getInstance(document,
                     new FileOutputStream("test.pdf"));

  PdfContentByte cb = writer.getDirectContent();

  Graphics2D g2 = cb.createGraphics(width, height)
  
  print(g2);  // I'm inside of a subclass of JTextPane, so this prints the
text pane


I haven't seen any way to do something like this using iText to try to
convert to html.  I guess I need some kind of Graphics2D object that will
create html when I print to it.  Is there anything like this?  Am I going
down the wrong road?  Should I give up?

Thanks.

Steve Sinai
-- 
View this message in context: 
http://www.nabble.com/Converting-Swing-JTextPane-to-HTML-with-iText-tp19014796p19014796.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to