Exemplo n.º 1
0
 /* (non-Javadoc)
  * @see com.itextpdf.tool.xml.ITagProcessor#endElement(com.itextpdf.tool.xml.Tag, java.util.List)
  */
 public override IList<IElement> End(IWorkerContext ctx, Tag tag, IList<IElement> currentContent) {
     IList<IElement> l = new List<IElement>(1);
     ListItem li = new ListItem();
     foreach (IElement e in currentContent) {
             li.Add(e);
     }
     if (li.Trim()) {
         l.Add(li); // css applying is handled in the OrderedUnorderedList Class.
     }
     return l;
 }
 /* (non-Javadoc)
  * @see com.itextpdf.tool.xml.ITagProcessor#endElement(com.itextpdf.tool.xml.Tag, java.util.List)
  */
 public override IList<IElement> End(IWorkerContext ctx, Tag tag, IList<IElement> currentContent) {
     IList<IElement> l = new List<IElement>(1);
     ListItem li = new ListItem();
     float maxSize = -1;
     foreach (IElement e in currentContent) {
         li.Add(e);
         //finding max leading among list item elements
         foreach (Chunk chunk in e.Chunks) {
             // here we use 4f/3 multiplied leading value to simulate leading which is used with default font size
             float currFontSize = chunk.Font.GetCalculatedLeading(4f/3);
             if (maxSize < currFontSize) {
                 maxSize = currFontSize;
             }
         }
     }
     if (li.Leading < maxSize)
         li.Leading = maxSize;
     if (li.Trim()) {
         l.Add(li); // css applying is handled in the OrderedUnorderedList Class.
     }
     return l;
 }