views:

943

answers:

0

I'm trying to tile an image or background image in a table cell in iTextSharp. The closest I have gotten is to attach an image directly to the cell using a PdfPTable and PdfPCell.

tempCell = new PdfPCell();
tempCell.Image = iTextSharp.text.Image.GetInstance(Path.Combine(GetImageDirectory(), "my_image.gif"));
table.AddCell(tempCell);

This has its issues, though. The cells are never the same size in my tables, so the images are scaled automatically by width. This can make some of the cells extra tall comparatively to other cells, or only half full of the image if they are narrow.

Any suggestions on how to get the images tiling, if it is even possible with iTextSharp? Thanks!