Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Sat Dec 14, 2019 12:57 am

Hello
I have to draw a shape over a table cell and do not know how to compute the actual height of the cell (or row) to dim the shape.
Thank's for any help

danielhalte1
 
Posts: 23
Joined: Sat Dec 14, 2019 12:50 am

Mon Dec 16, 2019 6:53 am

Hi,

Thanks for your inquiry.
If your table row has been set specific row height, you could use TableRow.Height to get the height.
Code: Select all
            Table table = sec.Tables[0] as Table;
            TableRow row = table.Rows[0];
            float height = row.Height;

If you still have the issue, please share your input file(if any) and the code you were using for further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Dec 16, 2019 9:52 pm

thank you for your reply

And, no, it is not that simple.
My problem is : some text wrap, and the row height grows.
I thought that Spire.Doc provided some facility to calculate final height.
In fact, Spire defines properties of the document, but never render the document. Neither in docx, nor in pdf.

I'm afraid that If I would achieve the goal, I have to calculate it myself, with graphics, MeasureString, et cetera.

difficult, fragile

Shame.

danielhalte1
 
Posts: 23
Joined: Sat Dec 14, 2019 12:50 am

Tue Dec 17, 2019 1:49 am

Hi,

Thanks for your response.
There is no that direct function in Spire to get the actual height for your case. I am afraid you need to calculate it by yourself.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc