Get document height from RadDocument

2 posts, 0 answers
  1. Kurt
    Kurt avatar
    2 posts
    Member since:
    Mar 2015

    Posted 24 Mar 2015 Link to this post

    Hello,

    Is there a way to get the document height from RadDocument?
    Basically i want the distance from the first to the last line (in pixel).
  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    711 posts

    Posted 27 Mar 2015 Link to this post

    Hello Kurt,

    Thank you for writing. 

    You could get the size of the document by accessing the DesiredSize property of the RadDocument object of the RadRichTextEditor element:
    Telerik.WinForms.Documents.Model.SizeF size = this.radRichTextEditor1.Document.DesiredSize;

    Then you could convert this size to pixels based on the DPI settings on the client`s machine. I believe that you might find the following threads useful:
    http://stackoverflow.com/questions/139655/convert-pixels-to-points
    https://msdn.microsoft.com/en-us/library/windows/desktop/ff684173%28v=vs.85%29.aspx

    I hope this information is useful. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top