コード例 #1
0
ファイル: PdfService.cs プロジェクト: ucdavis/Dogbert
        private List BuildListObject(List<HtmlElement> elements, string listType, PdfPCell pCell = null)
        {
            var docObjs = new Stack<HtmlElement>();
            var lt = listType == "ol" ? List.ORDERED : List.UNORDERED;

            // remove the ol objects
            elements.RemoveAll(a => a.Value == listType);

            var list = new iTextSharp.text.List(lt);
            if (lt == List.UNORDERED) list.SetListSymbol("\u2022");
            list.IndentationLeft = 10f;

            foreach (var a in elements)
            {
                var obj = HandleTag(docObjs, a, pCell);
                if (obj != null)
                {
                    list.Add(new ListItem(obj));
                }
            }

            if (pCell != null) pCell.AddElement(list);

            return list;
        }