Make each listing a ColumnText and get the height of each one but don't
place them. You now have a list of heights. Place your image and do your
calculations on the free space. In the case of 3 columns you would have 6
free spaces. Even with a brute force approach it's fast to find the best
match. Place the ColumnText in the free spaces.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Vimlesh [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, February 18, 2002 18:32
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] help
> 
> help
>  
> Hi, 
> I have been mailing my Query 
> I am working on creating a directory management system which will generate
> PDF's ready to print directory. I am using iTExt for my project and new to
> it. My basic requirement is there is Business Rule in my application that
> an Advertisement should come below or above the listing. So I need to
> place the Advertisement Image exactly below the listing or above the
> listing. My data is coming from the database in a sorted manner and I have
> to accordingly place the listings and adverstisement in the PDF files. Now
> the problem is that in case of 3 column page if the Advertisement is 3
> columns Advertisement and if that Advertisement coming from the database
> falls in 2nd or 3rd column I have to go backwards and again shuffle the
> listings right from column 1 so that my adverstisement can be placed in
> the entire row horizontally and then span that 3 columns, so accordingly
> my other listings will shift down and the listing of that advertisement
> will also shift.  Means this is a recursive process and will keep
> happening. 
> Also the entire listing should be together means that the entire listing
> should be in one single block, this block cannot be broken into 2 columns
> or should not come on separate page. I am stuck with these 2 problems. If
> anyone could help on this I will be highly obliged.
> Given below is the image of the same for your better undertstanding.
>  << File: Advertisementcolumns.jpg >> 
> Thanks
> Vimlesh Mittal

_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to