Index page using Pdf export

1 Answer 183 Views
PDF Export
Jeevathanan
Top achievements
Rank 1
Jeevathanan asked on 13 May 2022, 09:21 AM
Is it possible to create index page using Pdf export?

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 18 May 2022, 05:28 AM

Hi Jeevathanan,

The question was been answered in a private support thread but sharing the information here for visibility.

To print the page number in the exported PDF document, the developer can use kendoPDFTemplate. The template receives the number of the current page (pageNum) and the total number of pages (totalPages).

<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>

Please check the following topic and example with it:

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

In this case, the page numbers are rendered at the top of the page. In case they need to appear at the bottom, custom CSS code needs to be used, to style the element as necessary.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
PDF Export
Asked by
Jeevathanan
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or