We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Help! Problem in displaying full image in pdf on html (containing table) bound


We are using the code below to bind html to the pdf. When the html has a table and an image inside a td tag, the image in the td is not shown fully on the generated pdf. e.g: There is a table with two tr's and 2 td'd in each tr. The first td in the first row has some text in it and the second td has an image. when the pdf is generated, we only see half of the image shown in the pdf . please have a look at the code below used to convert html to pdf. How do we display the complete image.



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;


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];



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.


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("");


//if (iSummaryNo != 0)

// {

objLastSec.IsNewPage = false;


iSummaryNo = iSummaryNo + 1;





Can you please save the html to a file and send it to us along with the image so that we can more accurately figure out the cause of the problem.