Page number and more when exporting in pdf

6 posts, 0 answers
  1. Andrea
    Andrea avatar
    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
    Admin
    Jack avatar
    2335 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. UI for WinForms is Visual Studio 2017 Ready
  4. Udo
    Udo avatar
    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
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 29 Dec 2014 Link to this post

    Hi Udo,

    Thank you for your opinion. Here is a feature request for such a functionality where you can add your vote: http://feedback.telerik.com/Project/154/Feedback/Details/111266-add-radgridview-one-should-be-able-to-show-the-header-row-on-each-page-exporte. And here is another one for the page number: http://feedback.telerik.com/Project/154/Feedback/Details/111264-add-radgridview-add-header-and-footer-functionality-when-exporting-to-pdf.

    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.

     
  6. Sanjay
    Sanjay avatar
    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

     

  7. Stefan
    Admin
    Stefan avatar
    2891 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);
    }

    More information regarding RadPdfProcessing is available here: http://www.telerik.com/help/winforms/pdfprocessing-editing-fixedcontenteditor.html.

    I hope this helps.

    Regards,
    Stefan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready