This is a migrated thread and some comments may be shown as answers.

Pages in the RadDocument

1 Answer 90 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Anand
Top achievements
Rank 1
Anand asked on 19 Aug 2014, 01:28 PM
Is there any way that I can get the list of pages a document. Or any another way to work out pages from a document ?

Regards
Anand

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 22 Aug 2014, 11:09 AM
Hi Anand,

The document model of RadRichTextBox has no concept of pages, as they are determined based on the available page size. However, depending on what you want to achieve you can access the content of each page using document positions, for example:
DocumentPosition start = new DocumentPosition(this.radRichTextBox.Document);
DocumentPosition end = new DocumentPosition(this.radRichTextBox.Document);
 
start.MoveToFirstPositionInDocument();
end.MoveToFirstPositionInDocument();
end.MoveToFirstPositionOnNextPage();
end.MoveToPrevious();
 
//select the content on the first page
this.radRichTextBox.Document.Selection.AddSelectionStart(start);
this.radRichTextBox.Document.Selection.AddSelectionEnd(end);

I hope this helps.

Regards,
Petya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
RichTextBox
Asked by
Anand
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or