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

Free Support Forum - aspose.com

How to know the distance between a shape base and the bottom of the document

I’m trying to build a diagram on a word ducument, but i need to know the remaining distance beteen a Shapebase and the bottom of the document(including the footer section).
Like this I can put a page break.
Have you a solution for me?
Thank you!

Thanks for your inquiry. You can determine this distance if you use RelativeVerticalPosition.Page; For example see the following code.

Document doc = new Document();
Shape awShape = new Shape(doc, ShapeType.Image);
awShape.RelativeVerticalPosition = RelativeVerticalPosition.Page;
awShape.VerticalAlignment = VerticalAlignment.Bottom;
awShape.VerticalAlignment = VerticalAlignment.Center;
awShape.DistanceBottom = 50; //Set distance between shape and bottom of page.

But you can’t determine the end of page. Aspose.Words document represents content and formatting of a document, not its layout into lines and pages. This feature is called pagination and it is not released yet.
See FAQ for more information.
Best regards.