If you use HTMLWorker, you don't have to worry about parsing
the XHTML snippet yourself, you just have to define the style for
each tag.
br,
Bruno

sundowner wrote:

Now i have got the following code-snippet:
-------------------------------
String text = val.getStringValue();            //my Text to print out 
StringReader reader = new StringReader(text);
                        
StyleSheet styles = new StyleSheet();
styles.loadTagStyle("strong", "font-weight", "bold");
styles.loadTagStyle("strong", "font-size","8");
                        
HTMLWorker htmlWorker = new HTMLWorker(document);
ArrayList cc = new ArrayList();
cc = htmlWorker.parseToList(reader, styles);
                        
Phrase p1 = new Phrase();
for (int i = 0; i < cc.size(); i++){
Element elem = (Element)cc.get(i);
p1.add(elem);
}
cell = new PdfPCell(p1);
----------------
Problem: The style is not working. Only the color is red, but the size is
too big. What am i doing wrong ?

Bjoern
-- 
View this message in context: 
http://www.nabble.com/Converting-HTML-in-PDFPCell-tp14684165p14689778.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to