AddElement() public method

public AddElement ( IElement element ) : void
element IElement
return void
        private MemoryStream TelephoneListPDFStream()
        {
            MemoryStream stream = new MemoryStream();
            Document document = new Document();

            try
            {
                PdfWriter pdfWriter = PdfWriter.GetInstance(document, stream);
                pdfWriter.PageEvent = new ITextEvents();
                pdfWriter.CloseStream = false;
                document.Open();

                string fontpath = Server.MapPath(@"~/fonts/");
                BaseFont OxfamGlobalHeadline = BaseFont.CreateFont(fontpath + "OxfamGlobalHeadline.ttf",
                    BaseFont.CP1252, BaseFont.EMBEDDED);

                Paragraph heading = new Paragraph("TELEFOONLIJST", new Font(OxfamGlobalHeadline, 28f, Font.BOLD));
                heading.SpacingAfter = 40f;
                heading.Alignment = Element.ALIGN_CENTER;
                document.Add(heading);

                int rowsPerPage = 43;

                MultiColumnText columns = new MultiColumnText();
                //float left, float right, float gutterwidth, int numcolumns
                columns.AddRegularColumns(36f, document.PageSize.Width - 36f, 24f, 2);
                columns.AddElement(GetPdfPtableInternWithoutLog(rowsPerPage));
                columns.AddElement(new Paragraph("OFTL",
                    new Font(Font.HELVETICA, 9f, Font.BOLD)));
                columns.AddElement(GetPdfPtableExternLog());

                document.Add(columns);

                document.NewPage();
                document.Add(heading);

                columns = new MultiColumnText();
                //float left, float right, float gutterwidth, int numcolumns
                columns.AddRegularColumns(36f, document.PageSize.Width - 36f, 24f, 2);
                columns.AddElement(GetPdfPtableGSMAndFunction(rowsPerPage));

                document.Add(columns);
            }
            catch (DocumentException de)
            {
                Console.Error.WriteLine(de.Message + "My DocumentException");
            }
            catch (IOException ioe)
            {
                Console.Error.WriteLine(ioe.Message + "My IOException");
            }

            document.Close();
            stream.Flush();
            stream.Position = 0;

            return stream;
        }
        private void GenerateProviderIndex(Document doc, IEnumerable<IGrouping<string, PrintableProviderDto>> providersBySpeciality)
        {
            var providerIndexHeader = new Paragraph("Provider Index", fonts["h1"]);
            providerIndexHeader.SpacingAfter += 10;
            doc.Add(providerIndexHeader);
            var providerIndexTable = new PdfPTable(1);
            providerIndexTable.WidthPercentage = 100;
            var providers = providersBySpeciality.SelectMany(x => x).Distinct().OrderBy(a => a.LastName).ThenBy(a => a.FirstName);

            MultiColumnText columns = new MultiColumnText();
            //Add regular columns parameters - float left, float right, float gutterwidth, int numcolumns
            columns.AddRegularColumns(36f, doc.PageSize.Width - 36f, 24f, 3);
            foreach (var provider in providers)
            {
                PdfPCell cell = GenerateProviderIndexLink(provider);
                providerIndexTable.AddCell(cell);
            }
            columns.AddElement(providerIndexTable);
            doc.Add(columns);
        }