Detect position of bookmark on a page

Hi,

I have a document I am merging to, then, at a specific bookmark my application is creating a table using documentbuilder, then writing to that bookmark. I would like to get the bookmark’s position on the page.


I have tried the following:


LayoutCollector layoutCollector = new LayoutCollector(tableDoc1);

LayoutEnumerator layoutEnumerator = new LayoutEnumerator(tableDoc1);

BookmarkStart bmStart = dstDoc.Range.Bookmarks[“Address”].BookmarkStart;

var renderObject = layoutCollector.GetEntity(bmStart);

layoutEnumerator.Current = renderObject;

RectangleF location = layoutEnumerator.Rectangle;



Unfortunately the renderObject is being returned as null despite the bookmark being detected and assigned to the BookmarkStart variable.

I’m using Aspose.Words 14.4.0.0

Hi John,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we'll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click 'Reply' button that will bring you to the 'reply page' and there at the bottom you can include any attachments with that post by clicking the 'Add/Update' button.