The attached sample project below demonstrates a possible workaround for PAGE and NUMPAGES fields when exporting to PDF. The demo shows how to generate document from scratch containing PAGE and NUMPAGES fields and export it to PDF.
It is also available with Telerik UI for WPF's latest internal build - LIB 2022.2.808 (08 Aug 2022) if you need it earlier.
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/.
Posted on:27 Aug 2019 07:55
Have you tested the example project attached to this item? It demonstrates how you can insert page numbers in the exported PDF and it seems like it would be helpful for the case you are encountering.
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.
Posted on:21 Aug 2019 02:06
I have a RadflowDocument, it contain header and footer with page number.When I export this to pdf, its generate a PDF without page number. Can you help me in this issue?
Posted on:31 Jul 2017 08:13
Since RadWordsProcessing doesn't provide any UI, it is performing a measurement only when exporting the document to PDF. In all other cases, only the information about the document and its elements is written while saving. Therefore, only when the document is converted to PDF, you can obtain the number of pages it contains.
In case you are working with the DOCX format, you can insert the NUMPAGES field in the document as demonstrated in the CustomCodeField topic (http://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/concepts/fields/customcodefield#inserting-numpages-field ). By doing this, a field will be inserted but won't be evaluated and when the user opens the document in an application working with .docx files (MS Word, for example), the values of the fields should be updated to show their values.
Posted on:27 Jul 2017 14:12
The only issue with this workaround is the performance drain in unnecessarily saving the flow document to a fixed document just to get the page count. This is taking more than 8 seconds on a 60 page PDF containing about 20 tables, which is less than ideal when we're only doing this to grab a page count. Can you think of another way which would not have such a performance overhead?