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