You have the class com.lowagie.text.html.simpleparser.HTMLWorker that
does exactly that. That class was created to parse html fragments and
return a list of Paragraph, List and PdfPTable that could be rendered
with ColumnText, it's not meant to parse a web page. That class was done
for a particular project and still needs some work on it before I can
"officially" release it but that won't happen before October. Currently
the tags supported are "ol ul li a pre font span br p div body table td
th tr i b u sub sup em strong h1 h2 h3 h4 h5 h6".
It's used like this:

StyleSheet style = new StyleSheet();
style.loadStyle("tablecells", "color", "#cccc99");
style.loadStyle("tablecells", "size", "8px");
style.loadStyle("tablecells", "align", "justify");
style.loadTagStyle("pre", "size", "8px");
style.loadTagStyle("a", "color", "blue");
style.loadTagStyle("a", "u", "");
style.loadTagStyle("table", "bgcolor", "aqua");
style.loadTagStyle("table", "align", "justify");
Reader reader = ...; // the Reader to your html data
ArrayList list = HTMLWorker.parse(reader, style);
 
Best Regards,
Paulo Soares


________________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
        Sent: Tuesday, August 31, 2004 3:30 AM
        To: [EMAIL PROTECTED]
        Subject: [iText-questions] Functionality
        
        
        I have html code stored in a database.  I currently use jasper
reports with the ireports designer but have no way to interpret the html
code when it is displayed, it simple shows all the tags.  Can iText be
used to generate a similiar report but display the html code as its
supposed to be (basically just has <h1><b><i><u> etc... around the
text).
         
         
        Chris Buchanan



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idP47&alloc_id808&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to