I seemed to have looked at all mailing list posts except the correct one
(titled "StyleSheet / HtmlWorker and granular font size").  I changed the
addHtml... method and the lists are working well.  Putting the HTMLWorker
output into a paragraph was not working.

// new code
        public void addHtmlToPdfContentByte(String html, PdfContentByte cb, 
float[]
pos) {
                StyleSheet styles = createDefaultStyleSheet();
                
                ColumnText c1 = new ColumnText( cb );
                c1.setSimpleColumn( pos[1] , pos[2] , pos[3] , pos[4] );
                c1.setYLine(pos[4]);            
                try {
                        ArrayList htmlObjs = HTMLWorker.parseToList(new 
StringReader(html),
styles);
                        for (int k = 0; k < htmlObjs.size(); ++k) {
                                c1.addElement((Element)htmlObjs.get(k));
                        }
                        c1.go(); 

                } catch (Exception e) {
                        throw new RuntimeException("HtmlToPdf: Could not parse 
HTML",e);
                }
        }
-- 
View this message in context: 
http://www.nabble.com/HTML-to-Pdf-Paragraph-Using-ColumnText----Parsing-issue.-tp18560759p18561063.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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to