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

kendo-pdf-export add header and footer

1 Answer 255 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chaitra
Top achievements
Rank 1
Chaitra asked on 15 Sep 2018, 04:12 PM

Hi,

I am working on pdf export , As I am using 

https://www.telerik.com/kendo-angular-ui/components/pdfexport/

By placing the content in the <kendo-pdf-export> component. 

How I can add header and footer (with page number)?

Thanks

Amit

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 17 Sep 2018, 12:12 PM
Hello Amit,

You can use the PDF Export component's page templates to provide repeated content in the header and/or footer of the exported pages:

https://www.telerik.com/kendo-angular-ui/components/pdfexport/multi-page-content/#toc-page-templates

The page number (pageNum) and totalPages are available are exposed as context variables in the template:

<kendo-pdf-export #pdf paperSize="A4" margin="2cm">
     <ng-template kendoPDFTemplate let-pageNum="pageNum" let-totalPages="totalPages">
       <div class="pageNum">
         Page {{ pageNum }} of {{ totalPages }}
       </div>
     </ng-template>
     ...
   </kendo-pdf-export>

I hope this helps.

Regards,
Dimiter Topalov
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.
Tags
General Discussions
Asked by
Chaitra
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or