Insert inline TextBox using Aspose.Words for Java

Hi,

I currently have a problem inserting a TextBox using Aspose.Words for Java.

When specifying the width of the shape to lets say 200 and furthermore configuring WrapType.INLINE as well as FitShapeToText to true everything works as expected. But when calculating the max available width of the page and setting this value as width, the text following the shape is hidden below the shape itself. It seams that aspose just wraps it to the next line ignoring the actual hight of the shape.

I attached two documents. The first one illustrates how the shape is handled with width set to 200 and the other on with width set to the max available width.

I won’t be able to specify the hight property because I actually don’t know how much content is going to be rendered in the shape.

Best,
Tobias

Hi Tobias,

Thanks for your inquiry.

It appears this is the correct behaviour of wrapping around a textbox, as if you attempt the same thing using MS Word, it will "wrap" the text behind the textbox still. You can try this by using your first document and simply enlarging the textbox to the same width of the page.

To achieve this functionality, assuming you are not planning to render the document to PDF or an image, is to use a one cell table with wrapping set to "around" in place of a textbox.

If you have any further queries regarding this could you please post your full template here that will demonstrate exactly what you would like to achieve.

Thanks,