Hi, looking through the examples, I don't see any way to add images into a PageElements.Table's Cell element. I know how to add a standalone image to the page, and how to create a table with text in its cells, but I don't see an example of adding images to cells. Can this be done?
Thx,
Chad
Images within table?
Re: Images within table?
Support · Nov 21, 2006Chad, yes this can be done. Take a look at the CellList "Add" method's overloads. There are several "Add" methods that can take any page element including an Image. The help documentation page listing those "Add" method overloads can be found here: http://www.DynamicPDF.com/Support/NET_Help_Library_06_03/ceTe.DynamicPDF~ceTe.DynamicPDF.PageElements.CellList~Add.html
.
Thanks,
ceTe Software Support Team
Re: Images within table?
Forum member · Nov 21, 2006I get it. Thanks.
Re: Images within table?
Forum member · Jan 3, 2007But i don't
The New Image contains X and Y position, but that is absolute to the page, not the cell
i have a table, with 4 cells in each row, i want a picture in cell 1 and 3, how do i do that?
Re: Images within table?
Support · Jan 3, 2007Hello,
When adding an image to the Cell of a table it will take the X, and Y coordinates corresponding to the cell but not to the page. Following is the sample code which adds image to the 1st and 3rd cells of each row.
C# Code:
Document doc = new Document();
Table table = new Table(100,100,400,500);
table.Columns.Add(100);
table.Columns.Add(100);
table.Columns.Add(100);
table.Columns.Add(100);
Image img = new Image(@"D:\Images\logo.tif",0,0,0.2F);
for(int i=0;i<2;i++)
{
Row row = table.Rows.Add();
row.Cells.Add(img);
row.Cells.Add("Cell 2");
row.Cells.Add(img);
row.Cells.Add("Cell 4");
}
Page page = new Page();
page.Elements.Add(table);
doc.Pages.Add( page );
doc.DrawToWeb();
Thanks,
ceTe Software Support Team.