Images in Tables for Slides PowerPoint

Received : 2007/07/31 14:14:26
Message : Hi,
You guys have been great in assisting me figure out if Aspose is right for me. I'm pretty much happy with the product, but I'm trying to figure out one more thing before purchasing. I need to be able to put images into Tables. I went through your wiki and found how to create a table, but having trouble trying to figure out how to put an image. Thanks for your help again!


This message was posted using Aspose.Live 2 Forum

You can use DocumentBuilder move methods to position inside the table and DocumentBuilder.IsertImage method to insert image into the position.

Hope this helps,

I couldn’t find DocumentBuilder in the Java Slides API. Do you have any other suggestions or sample code I might be able to look at? Thanks again for your help.

Hi I found the the addPictureFrame function and that works. The only problem I have no is when I try to get the x,y location of a cell within a table. It gives me the correct x,y for cell 0,0 ... but if its any other cell, the Y value is off. Do you have any ideas?

Hi


Your request is related to another component (Aspose.Slides). That's why I move it to corresponding forum. Their technical support will respond to you soon.


Best regards.

Dear Crafte,

To access any cell inside the table use Table.getCell(col, row) where col>=0 and row>=0

You can insert a pictureframe inside a table cell by following these steps

-- Get the desired table cell

Cell srcCell=tbl.getCell(1,2) //getting cell of column 2 and row 3

-- Get the X, Y position of the table cell using its textframe

int posX=srcCell.getTextFrame().getX();

int postY=srcCell.getTextFrame().getY();

-- Create a Picture object, add it into Presentation.getPictures().add(Picture) method and save its picture id returned by it

int picID=srcPres.getPictures().add(pic);

-- Add a PictureFrame with the picture id and set its height and width

PictureFrame pf=srcSlide.getShapes().addPictureFrame(picID, posX, posY,

tbl.getColumnWidth(srcCol), tbl.getRowHeight(srcRow));