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

Free Support Forum - aspose.com

Inserting a picture next to a table

Hello Aspose Team,

I am trying to insert a picture next to a 5 row table using the builder.
(See attached image for a sketch).

The image should be added after the table (after I call builder.endTable();). However I cannot achieve this. The image is beeing added just beneath the table.

Any ideas or hints will be greatly appreciated.

Thanks ahead!
Lucian.

Hi Lucian,


Thanks for your inquiry. You can insert a floating image at any position on a page. Please see the following code for example:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape img = builder.insertImage(getMyDir() + “aspose.words.jpg”);

img.setWrapType(WrapType.NONE);
img.setLeft(100);
img.setTop(200);

doc.save(getMyDir() + “out-java.docx”);

Best regards,

Thanks a lot for the response.
Right after I asked, I found the Shape in the API documentation :slight_smile:

Cheers!