I'm trying to create Pdf using itextsharp. I have added one table conataining two columns one containing text and other image. I want to have constant image size
My Image automatically resizes if the text present in another cell increases and image present in other cell has different sizes
for (int i = 0; i < visitInfo.VisitsiteComplience.Count; ++i) { cellprop.Colspan = 1; cellprop.Pharse = visitInfo.VisitsiteComplience[i].Compliencedescription; cellprop.BaseColor = null; table.AddCell(AddCelltoTable(cellprop)); yesicon.ScaleAbsolute(35f, 35f); noicon.ScaleAbsolute(35f, 35f); if (visitInfo.VisitsiteComplience[i].Status == "1") { statuscell.AddElement(new Chunk(noicon, 0, 0)); } else { // statuscell.AddElement(new Chunk(noicon, 0, 0)); } statuscell.FixedHeight = 10; //headerLeftCell.Border = PdfPCell.NO_BORDER; table.AddCell(statuscell); }
2. Then I changed the code but now Image size increases and occupies full cell
for (int i = 0; i < visitInfo.VisitsiteComplience.Count; ++i)
{
cellprop.Colspan = 1;
cellprop.Pharse = visitInfo.VisitsiteComplience[i].Compliencedescription;
cellprop.BaseColor = null;
table.AddCell(AddCelltoTable(cellprop));
yesicon.ScaleAbsolute(35f, 35f);
noicon.ScaleAbsolute(35f, 35f);
if (visitInfo.VisitsiteComplience[i].Status == "1")
{
statuscell.AddElement(new Chunk(noicon, 0, 0));
}
else
{
// statuscell.AddElement(new Chunk(noicon, 0, 0));
}
//headerLeftCell.Border = PdfPCell.NO_BORDER;
table.AddCell(statuscell);
}