Archit Shrivastava

Archit Shrivastava

  • NA
  • 416
  • 118.6k

how to add dynamic image to table cell

Sep 3 2018 2:47 AM
i want to add dynamic Images to html table ,here code sample
 
StringBuilder sb = new StringBuilder();
sb.Append("<table border=1 width = 400>");
sb.Append("<tr><td width=7% height = 50% width=70% rowspan =4>ID</td><td >Name</td></tr>");
sb.Append("<tr><td>1</td><td>"+(name)+"</td></tr>");
sb.Append("<tr><td>2</td><td>" + (rank) + " </td></tr>");
sb.Append("<tr><td>3</td><td>" + (rank) + " </td></tr>");
sb.Append("</table>");
StringReader sr = new StringReader(sb.ToString());
string path = "C:\\Users\\Archit\\Desktop\\test.pdf";
StringWriter sw = new StringWriter();
var output = new FileStream(path, FileMode.Create);
iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.A4, 10F, 10F, 10F, 0F);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
iTextSharp.text.pdf.PdfWriter.GetInstance(pdfDoc, output);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
 
 
here i set name etc.but i want to set image too.