views:

128

answers:

0

I'm trying to override the OnEndPage event but I get the error message that there is no suitable method found to override

        public override void OnEndPage(PdfWriter wri, Document doc)
    {
        PdfPTable table = new PdfPTable(1);
        table.TotalWidth = doc.PageSize.Width - doc.LeftMargin - doc.RightMargin;
        PdfPTable table2 = new PdfPTable(2);

        PdfPCell cell2 = new PdfPCell(new Phrase("Test Top"));
        cell2.Colspan = 2;
        table2.AddCell(cell2);

        cell2 = new PdfPCell(new Phrase("\nTitle", new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.HELVETICA, 16, iTextSharp.text.Font.BOLD | iTextSharp.text.Font.UNDERLINE)));
        cell2.HorizontalAlignment = Element.ALIGN_CENTER;
        cell2.Colspan = 2;
        table2.AddCell(cell2);

        PdfPCell cell = new PdfPCell(table2);
        table.AddCell(cell);

        table.WriteSelectedRows(0, -1, doc.LeftMargin, doc.PageSize.Height - 37, wri.DirectContent);

    }

Is gently nestled between two button calls... Am I doing something wrong? If I am, and if possible, can a example with full source for the entire PDR/Header generation be provided? I've had no luck finding them and I'm starting to go mad, haha

Thanks for any help