We create a RadFlowDocument with a table of contents and some fields (page, numpages). We want to convert it to PDF, but the table of contents and fields are not updated in the PDF, even though I have executed the UpdateFields method before. How can I proceed?
Thank you for your help!
1 Answer, 1 is accepted
0
Petya
Telerik team
answered on 01 Jun 2015, 04:54 PM
Hello Stéphane,
RadWordsProcessing doesn't genuinely support most types of fields and cannot update them in the document. The feature is in our backlog and you can vote for its implementation through the public portal: Table of Contents Field, Page Numbering Fields - PAGE, NUMPAGES.
In the meantime it is possible to create a field with WordsProcessing and export the document to DOCX, but you'd need to depend on the consumer (e.g. MS Word or another word processor) to update its values.
Until this functionality is implemented you could try calculating the values of the fields after the document has been exported to PDF format and drawing them. For example, try using the ExportToFixedDocument() method of the PdfFormatProvider and draw page numbers on each page of the fixed document like this:
var provider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();