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

Free Support Forum - aspose.com

How to add two images into one table cell?


Can you please show me how to add two images and a html tag
into one table cell?

I tried this but got an error message:

Row1C1.Paragraphs.Add(image1 + "
" + image2);

Many thanks in advance for your help.


Thank you for considering Aspose.

Here is the code for you.


Pdf pdf1 = new Pdf();

//////Create a section in the Pdf instance

Aspose.Pdf.Section sec1 = pdf1.Sections.Add();

////Create a Table object

Aspose.Pdf.Table pdfCurrentTable = new Aspose.Pdf.Table(sec1);

Aspose.Pdf.Row row0, row1, row2, row3;

row0 = pdfCurrentTable.Rows.Add();

Aspose.Pdf.Cell cell0, cell1;

cell0 = row0.Cells.Add();

//Create an image object

Aspose.Pdf.Image image1 = new Aspose.Pdf.Image();

//Set the path of image file

image1.ImageInfo.File = @"E:\AsposeTest\BDR_(2495)_exp_08-06-2007_18h20m09s70ms.doc.003.png";

//Set the type of image using ImageFileType enumeration

image1.ImageInfo.ImageFileType = ImageFileType.Png;


string s = "

Text t1 = new Text(s);

t1.IsHtmlTagSupported = true;


//Create an image object in the section

Aspose.Pdf.Image image2 = new Aspose.Pdf.Image();

pdfCurrentTable.DefaultCellBorder = new BorderInfo((int)BorderSide.All, 0.1F);

//Set the path of image file

image2.ImageInfo.File = @"E:\AsposeTest\BDR_(2495)_exp_08-06-2007_18h20m09s70ms.doc.003.png";

//Set the type of image using ImageFileType enumeration

image2.ImageInfo.ImageFileType = ImageFileType.Png;


cell1 = row0.Cells.Add();

string s2 = "Second Cell";

Text t2 = new Text(s2);




Hope it helps.


Thanks Adeel. It worked.