This is a migrated thread and some comments may be shown as answers.

Adding content to exported pdf, on the last page

2 Answers 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 04 Feb 2019, 03:54 PM

Hi,

Is there a way to add content to the end of a pdf document? I wish to show a signature at the end of the document only. Every time I try this, the signature is added at the end of every page. I only want to show it on the last page. Is this possible?

I am using the pdf export from the kendo ui grid.

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 06 Feb 2019, 01:37 PM
Hi, Jonathan,

Yes, it is possible to place content only on the last page of the Kendo UI Grid PDF export with the help of a Kendo UI Template.

The template will allow you to add a condition to check if the export is at the last page like below:

https://dojo.telerik.com/@bubblemaster/EbupAtuk

<script type="x/kendo-template" id="page-template">
     <div class="page-template">
       <div class="header">
         <div style="float: right">Page #: pageNum # of #: totalPages #</div>
         Multi-page grid with automatic page breaking
       </div>
        # if(pageNum === totalPages){#
           <h1 class="last-page">Last Page</h1>
         #} else {#
       <div class="watermark">
           KENDO UI
       </div>
        # } #
       <div class="footer">
         Page #: pageNum # of #: totalPages #
       </div>
     </div>
   </script>

More about templates: https://docs.telerik.com/kendo-ui/framework/templates/overview
Grid API reference - pdf.template: https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/pdf.template

Let me know in case you have further questions,

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jonathan
Top achievements
Rank 1
answered on 06 Feb 2019, 03:31 PM
Thank you, this worked well. I forgot that you could use javascript in the code like that.
Tags
Grid
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or