# Page number and more when exporting in pdf

1. ##### Andrea
1 posts
Member since:
Jul 2012

Posted 20 Dec 2011 Link to this post

Is there any way to add page number and repeat column header on every page when exporting gridview to pdf?
Thanks
2. ##### Jack
2333 posts

Posted 23 Dec 2011 Link to this post

Hello Andrea,

Thank you for writing.

Currently our export to PDF feature does not support page customization and we have not planned these features. Nevertheless, if more people request the same, we will consider improving our API.

You could try using the PageTitle property of ExportToPDF to mimic the repetition of the header cells on each page. The PageTitle property is a string property so you will have to experiment a bit to align the text with the columns.

Should you have other questions, I would be glad to assist.

Regards,
Jack
the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
3. ##### Udo
1 posts
Member since:
Sep 2014

Posted 27 Dec 2014 in reply to Jack Link to this post

"Is there any way to add page number and repeat column header on every page when exporting gridview to pdf?"
I think too, that this Feature - page customization - makes sense.

"You could try using the PageTitle property of ExportToPDF to mimic the repetition of the header cells on each page. The PageTitle property is a string property so you will have to experiment a bit to align the text with the columns."

This can not be the solution.

Greetings
Udo
4. ##### Stefan
2906 posts

Posted 29 Dec 2014 Link to this post

Hi Udo,

I hope that you find this useful.

Regards,
Stefan
Telerik

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

5. ##### Sanjay
21 posts
Member since:
Jun 2014

Posted 21 Sep 2015 Link to this post

Hi There,

We are using version 2015.1.225.40. When gridview is exported to PDF using either SpreadExport or ExportToPDF ,can we put page number on each PDF documents generated, i..e Page 1 of 3 , Page 2 of 3 , Page 3 of 3.

Thanks in Anticipation

6. ##### Stefan
2906 posts

Posted 21 Sep 2015 Link to this post

Hi Sanjay,

Thank you for writing.

Neither of the providers mentioned supports page numbering. However, you can use our PdfProcessing functionality and print the page number. Here is a small sample:
RadFixedDocument document;
PdfFormatProvider provider = new PdfFormatProvider();
using (Stream stream = File.OpenRead("..\\..\\text.pdf"))
{
    document = provider.Import(stream);

    foreach (RadFixedPage page in document.Pages)
    {
        FixedContentEditor editor = new FixedContentEditor(page);
        editor.Position.Translate(page.Size.Width / 2, page.Size.Height - 50);

        int pageNum = document.Pages.IndexOf(page)+1;
        editor.DrawText(pageNum + " of " + document.Pages.Count);
    }

}

using (Stream output = File.OpenWrite("..\\..\\text.pdf"))
{
    provider.Export(document, output);
}