Pages in the RadDocument

2 posts, 0 answers
  1. Anand
    Anand avatar
    30 posts
    Member since:
    Jul 2014

    Posted 19 Aug 2014 Link to this post

    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
  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 22 Aug 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top