We insert some HTML snippets into a PDF document using
HTMLWorker.parseToList and it worked fine in iText 2.1.2u (see following
code and resulting trace for an example):

            if (logger.isDebugEnabled())
                logger.debug("HTML="+html);
            elements = HTMLWorker.parseToList(new StringReader(html), st);
...
            for (Object o : e.getChunks()) {
                Font f = ((Chunk)o).getFont();
                logger.debug(f.getFamilyname()+"
font-size="+f.getCalculatedSize());
            }

     [java] DEBUG 02-04 10:01:47,232 (PdfUtil.java:parseHtml:430) -
HTML=<div
style='font-family:Helvetica;font-size:10.0;line-height:12.0;font-weight:normal;font-style:normal;'
before=5>insert text here</div>
     [java] DEBUG 02-04 10:01:47,234 (PdfUtil.java:addHtml:374) - Helvetica
font-size=10.0

but after moving to iText 2.1.5 (although it appears that the change was
first introduced in 2.1.3), we see the following trace:

     [java] DEBUG 01-04 17:49:56,394 (PdfUtil.java:parseHtml:430) -
HTML=<div
style='font-family:Helvetica;font-size:10.0;line-height:12.0;font-weight:normal;font-style:normal;'
before=5>text inserted here</div>
     [java] DEBUG 01-04 17:49:56,398 (PdfUtil.java:addHtml:374) - Helvetica
font-size=8.0

and the wrong size font is used.  I don't see where, but I believe that the
value of 8 is being defaulted somewhere, as we see this font-size being used
when the requested size is 12, 10, and 7.  I've tried to look at the changes
in HTMLWorker and FactoryProperties, but I don't know the structure of iText
well enough to make much progress in tracking this down, so any help or
suggestions would be greatly appreciated.

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

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

Reply via email to