The methods of RadDocumentEditor
are used to guarantee that the RadDocument
instance is properly updated and all required operations and updates are executed after modifying it. Thus, it triggers different methods that take care of these actions. We recommend using this class and its methods in scenarios where the edited document has been already measured.
However, when the document is just being created, you could directly use its model API
to construct the desired content. With this approach, the performance would be better but you should have in mind that once the document is measured (for example, visualized, printed or some content is selected), the RadDocumentEditor should be used when you need to modify it.
Here is an example of how you could modify the sample snippet from your post to use the model:
RadDocument document =
document.LayoutMode = DocumentLayoutMode.Paged;
Section section =
var stopwatch =
i = 0; i < 1500; i++)
Span span =
Paragraph paragraph =
Another approach that you could use to implement the end goal, is to create the document using our RadWordsProcessing
library. This library is part of Telerik Document Processing
and allows you create and modify documents of different file formats independently of platform and UI. You should be aware that, due to the specifics of the library, it currently doesn't support TOC fields. We have plans to implement this functionality in a future release and you could subscribe to get notifications about its progress through the related public feature request
Hope this helps.
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer
and share your thoughts.