meenakshi thilagam wrote:
> Hello Bruno,
> I have a question regarding your reply
> http://www.manning-sandbox.com/thread.jspa?threadID=16935&tstart=60

I was very clear in that reply, the main problem was
that the person asking the question didn't read the book.

> Here you have explained how to add images to a table
> in such a way that they are all of the same size.

Indeed, I refer to p177-178 of the book.
I quote: "Suppose you want to make a table containing
specifications of all the products that are sold by your
company. One of the columns should contain an image
displaying the product. These images have various heights
and widths, so you want iText to scale each image so that
it first into the table."
If that's what you want, you should read page 178
and adapt your code accordingly.

> Could you please explain 
> 
>       p->Add(new Chunk(img3,0,-img3->get_Height()/2));

That's not how it's explained in the book.
I don't understand why you wrap the image in a
Chunk and add it to a Paragraph or a Phrase.

>       cell->set_FixedHeight(img->get_Height()+6);
>       cell->set_cellPadding(10);
> I think that if padding is 20 then irrespective of the
> first 2 statements image is 
> made smaller (Iam not sure).

If you use setFixedHeight and the solution explained
on p178, the image will be smaller if you set a padding.

> My objective is to get a table with 2 colums and 3
> rows with Equal sized images.

Of course: if the images don't have the same aspect
ratio, they will have the same height, but not necessarily
the same width. There will be some extra white space.
You don't want the images to be stretched so that circles
change into oval, do you?

> what should I use scaletofit()  or the above approach.

Neither. You don't need scaleToFit and I don't understand
why the three lines of code you mention would scale the image.

> Please reply I have been struggling with this for a
> long time now.

You can save time by reading the book ;-)
br,
Bruno

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to