I am creating a single pdf page with 6 images in a table in separate cells, even though I am setting the images height and width on the server side exactly the same with Sca
Two things.
First, see this post about wrapping the Image
in a Chunk
. Basically:
iTextSharp.text.pdf.PdfPCell imgCell1 = new iTextSharp.text.pdf.PdfPCell();
imgCell1.AddElement(new Chunk(img1, 0, 0));
Second, if you want the exact same size then you want to use ScaleAbsolute
instead of ScaleToFit
. The latter keeps the aspect ratio of the image so a 100x200 image scaled to fit 50x50 would come out as 25x50.
img1.ScaleAbsolute(120f, 155.25f);