GemBox Support Forum

How to insert floating image base on an element position


What I am hoping to achieve is to insert a floating picture with TextWrappingStyle.InFrontOfText based on the position of an element inside the document model, and this target element could be on any page of the rendered document.

I have tried using Bookmark to locate this element, but I don’t know what to provide for HorizontalPosition and VerticalPosition .

Not sure what I am looking for is possible :slightly_frowning_face:

Please help.

Hi Allan,

With the FloatingLayout object, you can represent anything that you see in Microsoft Word’s Layout dialog:


But calculating those absolute positions is rather tricky, requires paginating the whole document content.
That is why I would suggest you change the approach, for example, use a placeholder image or a shape, or use a TextBox or TableCell to find the targeted position.

I hope this helps.

If this doesn’t work for you, can you please tell us a bit more about your exact requirement?
Perhaps you could share a sample document that shows what you have (a document with a bookmark) and another document that shows what you would like to get as a result (a document with an in-front-of-text image).

Thanks for your quick response.

Sure, we are looking for a way overlay signature over top of name on document to make it look more “authentic”. See below for an example…

We are currently using Table to generate the document and signature line, but we fail to figure out how to overlay the image on top of the text. Is there a way to anchor the FloatingLayout of the signature image to the TableCell?

Any suggestions is greatly appreciated.

How is the signature added, do you have a specific place in the template document where it must be placed?
If yes, how about you add a placeholder image that you will change when adding the signature?

Took me a while, but now I understand what you meant by placeholder image, and happy to report that it worked! Thanks!!!