Free Support Forum - aspose.com

Document size

Hi there,

I am just wondering if Aspose.word is capable of returning me back the appropriate height of document in inch.

Thanks

Alan

If you mean page height, you need to use DocumentBuilder.PageSetup.PageHeight property.

It returns height of the page in points. To convert it to inches use WordConvert.PointToInch Method.

I am sorry I didn't make myself clear. In my application I create a text frame as well as need to obtain the height of that text frame I created. I am just wondering if it's possible to do it using Aspose.word.

Thanks

Alan

Creation of text frames is not supported by Aspose.Word right now.

If you want to find the height of existing text frame, you need to find it in document. It has a Shape type. So you need to do something like this:

WordConvert.PointToInch(((Shape)doc.GetChild(NodeType.Shape, 0, true)).Height);

WordConvert.PointToInch(((Shape)doc.GetChild(NodeType.Shape, 0, true)).Height);

Is this function supported by Aspose.word right now?

Alan

This will return you height of the first shape (drawing object) in the document in inches.