iTextSharp.text.Chunk.setLineHeight C# (CSharp) Метод

setLineHeight() публичный Метод

public setLineHeight ( float lineheight ) : Chunk
lineheight float
Результат Chunk
        public Chunk setLineHeight(float lineheight)
        {
            return SetAttribute(LINEHEIGHT, lineheight);
        }

Usage Example

Пример #1
0
        private float AddText(string[] chunks, iTextSharp.text.Font font, float spacingBefore, float spacingAfter, int alignment, float lineHightMultiplier, Document doc)
        {
            int count = 0;
            float height = 0;
            var paragraph = new Paragraph();
            float fontSize = font.Size * lineHightMultiplier;
            var phrase = new Phrase();

            foreach(string item in chunks)
            {
                if (string.IsNullOrEmpty(item)) continue;
                var chunk = new Chunk(item + Environment.NewLine, font);
                chunk.setLineHeight(fontSize);
                phrase.Add(chunk);
                count++;
            }

            if (count > 0)
            {
                paragraph.Add(phrase);
                paragraph.Alignment = alignment;
                paragraph.SpacingBefore = spacingBefore;
                paragraph.SpacingAfter = spacingAfter;
                doc.Add(paragraph);
                height = spacingBefore + spacingAfter + count * fontSize;
            }

            return height;
        }
All Usage Examples Of iTextSharp.text.Chunk::setLineHeight