Document document = new Document(PageSize.A4, -60, -60, 30, 30);
public class FooterPDF : iTextSharp.text.pdf.PdfPageEventHelper { int i = 0; public override void OnEndPage(PdfWriter writer, Document document) { i += 1; //base.OnEndPage(writer, document); PdfPTable footerTable = new PdfPTable(1); footerTbl.TotalWidth = 216f; footerTable.TotalWidth = document.PageSize.Width; footerTable.LockedWidth = true; footerTable.SetWidths(widths); footerTable.HorizontalAlignment = Element.ALIGN_CENTER; Paragraph para = new Paragraph("© VIP FINANCIAL EDUCATION"); PdfPCell cell = new PdfPCell(para); cell.Border = 1; cell.PaddingLeft = 10; footerTable.AddCell(cell); para = new Paragraph(i.ToString()); cell = new PdfPCell(para); cell.HorizontalAlignment = Element.ALIGN_RIGHT; cell.Border = 0; cell.PaddingRight = 10; footerTable.AddCell(cell); footerTable.WriteSelectedRows(20, -1, 10, footerTable.TotalHeight, writer.DirectContent); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)