Free Support Forum -

Word - Get all the content lying to the left of left page margin


We have a word document with page left margin set. There are some contents ( textbox,table,paragraph,image etc.) before the left margin of the page. And some contents which is between left and right margin of the page. Is there any way to get all the content (from top to bottom) at left hand side (which lies before left margin) ? I do not want to check each and every node for its position,alignment and left or left indent values.

I will post some sample document later.

Meanwhile any suggestion how can we fetch content based on page left margin using aspose words for Java?


Hi Sonali,

Thanks for your inquiry.

Please note that Microsoft Word document is a flow document and it does not contain any information about its layout into lines and pages. Our Rendering Engine layouts documents into lines and pages and internally it is possible to determine position (x-y coordinates) of a particular node. But unfortunately, there is no public API, which allows you to determine where a Document Element is located. So, there is no way to find the position of the particular node on page.

Secondly, a TextBox is represented by a Shape node in Aspose.Words’ DOM. You may try considering the Shape.Left property to achieve what you’re looking for.

We will consider exposing layout information of nodes in the future. Your request has been linked to the appropriate issue (WORDSNET-2978) and you will be notified as soon as this API is available. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-2978) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.