Hi,

 

I've played with the html worker of 5.0.2 and stumbled upon some minor
issues. I'd like to propose the following fixes/enhancements. I'm not sure,
how to submit my proposals in a proper way, so I've just copied the
code-sections here.

 

Best regards,

Paul

 

HTMLWorker#startElement Line 229 . fix default 100% = 100, not 1

                                                               float hrWidth
= 100;

 

FactoryProperties#insertStyle after CSS_KEY_COLOR Line 360 add support for
background-color

            } else if (key.equals(Markup.CSS_KEY_BGCOLOR)) {

                BaseColor c = Markup.decodeColor(prop.getProperty(key));

                if (c != null) {

                    int hh = c.getRGB();

                    String hs = Integer.toHexString(hh);

                    hs = "000000" + hs;

                    hs = "#" + hs.substring(hs.length() - 6);

                    h.put("bgcolor", hs);

                }

 

And a few lines below CSS_KEY_LINEHEIGHT returned incorrectly from the
method which caused, that it depends on the other attributes key's hash, if
the property is applied .

                                                               if
(ss.endsWith("%")) {

 
h.put("leading", "0," + v / 100);

                                                               } else if
("normal".equalsIgnoreCase(ss)) {

 
h.put("leading", "0,1.5");

                                                               } else {

 
h.put("leading", v + ",0");

                }

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to