Ejemplo n.º 1
0
        /* ----------------------------------------------------------------- */
        ///
        /// AddNumericList
        /// 
        /// <summary>
        /// NOTE: 行間は,各種要素 (Paragraph, Section, List, NumericList)
        /// の末尾に空白を取る事で調整する.そのため,リストの最後の項目に
        /// 空白を挿入している.
        /// </summary>
        /// 
        /* ----------------------------------------------------------------- */
        private void AddNumericList(iText.ITextElementArray parent, Element element)
        {
            var list = new iText.List(true, _policy.NumericList.SymbolIndent);
            list.IndentationLeft = _policy.NumericList.Indent;
            while (_index < _parser.Elements.Count && _parser.Elements[_index].Type == element.Type) {
                var item = new iText.Paragraph(_parser.Elements[_index].Value, _policy.NumericList.Font);
                ++_index;
                if (_index >= _parser.Elements.Count || _parser.Elements[_index].Type != element.Type) {
                    item.SpacingAfter = _policy.NumericList.Spacing;
                }
                list.Add(new iText.ListItem(item));
            }

            parent.Add(list);
        }
Ejemplo n.º 2
0
 /* ----------------------------------------------------------------- */
 /// AddParagraph
 /* ----------------------------------------------------------------- */
 private void AddParagraph(iText.ITextElementArray parent, Element element)
 {
     var paragraph = new iText.Paragraph(element.Value,_policy.Paragraph.Font);
     paragraph.IndentationLeft = _policy.Paragraph.Indent;
     paragraph.FirstLineIndent = _policy.Paragraph.FirstLineIndent;
     paragraph.SpacingAfter = _policy.Paragraph.Spacing;
     parent.Add(paragraph);
     ++_index;
 }
Ejemplo n.º 3
0
        /* ----------------------------------------------------------------- */
        /// AddImage
        /* ----------------------------------------------------------------- */
        private void AddImage(iText.ITextElementArray parent, Element element)
        {
            var path = Path.IsPathRooted(element.Value) ? element.Value : Path.GetFullPath(element.Value);
            ++_index;
            if (!File.Exists(path)) return;

            var image = iText.Image.GetInstance(path);
            image.Alignment = _policy.Image.Alignment;
            image.SetDpi(_policy.Image.DPI, _policy.Image.DPI);
            parent.Add(image);
        }