Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Add page number to each page on PDF export
posted

How can I add page number to each of exported pages on PDF export?

Parents
  • 250
    posted

    One way of adding page numbering to a PDF document is with the following method. 

    private Infragistics.Documents.Report.Section.ISection AddTheMainSection(
    Infragistics.Documents.Report.
    Report report, bool continueWithPageNumbering)
    {

       Infragistics.Documents.Report.Section.
    ISection section = report.AddSection();

       // Configure Section Properties.
       section.PageSize = Infragistics.Documents.Report.PageSizes.A4;
       section.PageMargins.All = 35;
       section.PageBorders =
    new Infragistics.Documents.Report.Borders(Infragistics.Documents.Graphics.Pens.Black, TABLE_CELL_PADDING);
       section.PagePaddings =
    new Infragistics.Documents.Report.Paddings(TABLE_CELL_PADDING);
       // Page Numbering.
       section.PageNumbering = new Infragistics.Documents.Report.Section.PageNumbering();
       section.PageNumbering.Style = smallerBlueStyle;
       section.PageNumbering.Template =
    "Page [Page #] of [TotalPages]";
       section.PageNumbering.Continue = continueWithPageNumbering;
       section.PageNumbering.SkipFirst =
    false;
       section.PageNumbering.Alignment = Infragistics.Documents.Report.
    PageNumberAlignment.Right;
       section.PageNumbering.OffsetX = -15;
       return section;

         } // end helper AddTheMainSection()

Reply Children