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

Free Support Forum - aspose.com

Text flowing around images

Hi,


I am currently evaluating your Java offering for use with our software.

One of the main requirements we have is for flexible and easy to use page layout.

Within this we we like to be be able to position components on a PDF page e.g. images, tables and we would then like to add text content to the page that would “flow” nicely round the other components irrespective of their position on the page.

Is this something that can be achieved by your software, I have read your online documentation but see not obvious solution.

Thanks

Martin Knox
Futrix Ltd

Hi Futrix,


Thanks for your inquiry. You may add text on any specified location of Pdf document. Please check following documentation link for the purpose. If there is any difference in your requirement and my understanding then we will appreciate it if you please share a sample PDF document with desired results. So we will look into it and guide you accordingly.


Please feel free to contact us for any further assistance.

Best Regards,

Hi Martin,


Thanks for your interest in our products.

Adding more to Tilal’s comments, the contents in PDF file are added in flow layout (Top-Left to Bottom-Right) and objects are placed over place/position available over page. So in order to nicely utilize the space over page, you need to manually position the objects i.e. either by using Table object where you can place individual objects inside table cells or by using FloatingBox object which has obsolete positioning rather than flow-layout.

In case you encounter any issue while using our API, please share some sample image/file which can explain your requirement and help us in understanding it in more appropriate manner. For more information, please visit

Hi,

Thanks for the quick reply.

The table option is not suitable for us as the text being added to a page will be dynamic user entered text and we would not know in advance what text to put into each predefined table cell

Ideally we we like to add say an image top left and an image middle right of the page, then add a text component to the page that would flow though the page using the free space around the images for the text.

Is this something that the Floating Box component would support?

Martin

Hi Martin,


Thanks for sharing the details.

As described earlier, when placing objects inside PDF file, they are placed in flow layout and once an object is placed, it occupies the space till right border of page. By default, I am afraid it will not be possible to place an image inside PDF and when placing text object, the text will not automatically take the vacant/remaining space beside the image.

When using FloatingBox, yes it can be placed at obsolete location but when using this approach, you need to specify the location where FloatingBox should be placed. As a workaround, as shared earlier, please try using table object. I would also suggest to take a look over following link for further details on Placing a text around an image (the code is related to Aspose.Pdf for .NET but it gives a highlight about the approach which can be followed).