private void AddElement(Text text, PDF.MultiColumnText columns) { Paragraph para = new Paragraph(text); IT.Paragraph formatted = ParagraphFormatter.GetFormattedParagraph(para); AddToDocument(formatted, columns); }
//This method is used to add any Element part to the pdf file private void AddToDocument(IT.IElement pdfElement, PDF.MultiColumnText columns) { if (columns != null) { columns.AddElement(pdfElement); if (columns.IsOverflow()) columns.NextColumn(); document.Add(columns); } else { document.Add(pdfElement); } }
private void AddElements(Section section, PDF.MultiColumnText multiColPart) { Element[] elements = section.SubElements; foreach (var element in elements) { switch (element.GetElementType()) { case ElementType.Text: AddElement(element as Text, multiColPart); break; case ElementType.Paragraph: AddElement(element as Paragraph, multiColPart); break; case ElementType.Table: AddElement(element as Table, multiColPart); break; case ElementType.Image: AddElement(element as Image, multiColPart); break; } } }
private void AddElement(Table table, PDF.MultiColumnText columns) { IT.Paragraph tablePara = new IT.Paragraph(); tablePara.Add(TableFormatter.GetFormattedTable(table)); AddToDocument(tablePara, columns); }
private void AddElement(Paragraph paragraph, PDF.MultiColumnText columns) { IT.Paragraph para = ParagraphFormatter.GetFormattedParagraph(paragraph); AddToDocument(para, columns); }
private void AddElement(Image image, PDF.MultiColumnText columns) { IT.Image formattedImage = ImageFormatter.GetFormattedImage(image); AddToDocument(formattedImage, columns); }