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

Get document height from RadDocument

1 Answer 133 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Kurt
Top achievements
Rank 1
Kurt asked on 24 Mar 2015, 12:03 PM
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).

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 27 Mar 2015, 11:39 AM
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.

 
Tags
RichTextEditor
Asked by
Kurt
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or