Please have a look at the code below for generating pdf from html (containg image in a td):
///
/// This method is used to bind the article abstract with any images
/// to the PDF document from a Memory stream.
///
public void BindArticleAbstract()
{
//DSRReportData dsReportData = new DSRReportData();
//List articleAbstract = dsReportData.PopulateDataArticleAbstract(dtReportDate, 2);
DSRReportBusiness dsReportData = new DSRReportBusiness();
List articleAbstract = dsReportData.ArticleAbstract(dtReportDate, 2);
Text SecText = new Text("");
SecText.ID = "Article0";
Section objSection = objPdf.Sections.Add();
objSection.IsNewPage = true;
objSection.Paragraphs.Add(SecText);
int iSummaryNo = 0;
foreach (string sArticleAbstract in articleAbstract)
{
if(iSummaryNo !=0)
{
Text SecText1 = new Text("");
SecText1.ID = "Article" + iSummaryNo.ToString();
Section objFirstSec = objPdf.Sections[objPdf.Sections.Count - 1];
objFirstSec.Paragraphs.Add(SecText1);
}
string sAbstract = null;
sAbstract = sAbstract + "
" + sArticleAbstract;
sAbstract = sAbstract.Replace("\r\n", " ");
sAbstract = ModifyImageURL(sAbstract);
byte[] by = System.Text.Encoding.UTF8.GetBytes(sAbstract);
MemoryStream ms = new MemoryStream(by);
// Binding memory stream to a PDF file as HTML.
objPdf.BindHTML(ms);
Section objLastSec = objPdf.Sections[objPdf.Sections.Count - 1];
objLastSec.Paragraphs.Add(new Text(""));
objLastSec.Paragraphs.Add(new Text(""));
Aspose.Pdf.Table objTbl = new Aspose.Pdf.Table(objLastSec);
objTbl.ColumnWidths = "100%";
objTbl.Border = new BorderInfo((int)(BorderSide.Top), 1F, new Color("Grey"));
Row row = objTbl.Rows.Add();
Cell cell = row.Cells.Add("");
objLastSec.Paragraphs.Add(objTbl);
//if (iSummaryNo != 0)
// {
objLastSec.IsNewPage = false;
//}
iSummaryNo = iSummaryNo + 1;
}
}
}