iTextSharp.text.pdf.PdfPTable.AddCell C# (CSharp) Метод

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

public AddCell ( Image image ) : void
image Image
Результат void
        public void AddCell(Image image)
        {
            defaultCell.Image = image;
            AddCell(defaultCell);
            defaultCell.Image = null;
        }

Same methods

PdfPTable::AddCell ( PdfPCell cell ) : void
PdfPTable::AddCell ( PdfPTable table ) : void
PdfPTable::AddCell ( Phrase phrase ) : void
PdfPTable::AddCell ( String text ) : void

Usage Example

        protected virtual void WriteTOC(List<PdfContentParameter> contents, PdfWriter writer, Document document)
        {
            document.NewPage();
            PdfPTable t = new PdfPTable(2);
            t.WidthPercentage = 100;
            t.SetWidths(new float[] { 98f, 2f });
            t.TotalWidth = document.PageSize.Width - (document.LeftMargin + document.RightMargin);
            t.AddCell(new PdfPCell(
                new Phrase(GlobalStringResource.TableOfContents,
                    FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 16))
                ) { Colspan = 2, Border = Rectangle.NO_BORDER, PaddingBottom = 25 });

            foreach (PdfContentParameter item in contents)
            {
                if (!string.IsNullOrEmpty(item.Header))
                {
                    t.AddCell(
                        new PdfPCell(
                                new Phrase(item.Header,
                                    FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)
                                    )
                            ) { Border = Rectangle.NO_BORDER, NoWrap = false, FixedHeight = 15, }
                        );

                    PdfPCell templateCell = new PdfPCell(Image.GetInstance(item.Template));
                    templateCell.HorizontalAlignment = Element.ALIGN_RIGHT;
                    templateCell.Border = Rectangle.NO_BORDER;
                    t.AddCell(templateCell);
                }
            }
            float docHeight = document.PageSize.Height - heightOffset;
            document.Add(t);
        }
All Usage Examples Of iTextSharp.text.pdf.PdfPTable::AddCell