We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to get exact row height of table using .NET


I need to get the actual row height, even when the height rule is set as AUTO. As of now I have applied work-around for calculating height of the row using Rectangle, but it still does not provide accurate and precise heights, so can you please tell when shall feature WORDSNET-10671 shall be implemented?


Unfortunately, the implementation of feature WORDSNET-10671 had been postponed (no estimate is available at the moment). We will inform you via this thread as soon as this feature is available. We apologize for your inconvenience.

The height of a table row/cell is controlled using height and height rule properties. Please refer to the following article for more detail.
Specifying Row Heights

To calculate the table’s row height using Aspose.Words.Layout API, we suggest you following solution.

  1. Insert the bookmark in the first cell of row for which you want to calculate height.
  2. Insert another bookmark in the first cell of next row.
  3. Use the Aspose.Words.Layout API to get the top position of bookmarks. You can use LayoutEnumerator.Rectangle.Top.
  4. Please do the same for second bookmark.
  5. At the end get the difference of two position to get the row height.

Please note that LayoutCollector.GetEntity method returns an opaque position of the LayoutEnumerator which corresponds to the specified node. This method works for only Paragraph nodes, as well as indivisible inline nodes, e.g. BookmarkStart or Shape. It doesn’t work for Run, Row or Table nodes, and nodes within header/footer.