Hi,
A table in PowerPoint is a group of shapes.
It HSLF API it is represented by a org.apache.poi.hslf.model.ShapeGroup class.
Typically a table consists of TextBox and Line objects which represent
text runs and borders.
Below is sample code how to iterate over table cells:
Slide slide = ...;
Shape[] sh = slide.getShapes();
for (int i = 0; i < sh.length; i++) {
if (sh[i] instanceof ShapeGroup){ //got a table
ShapeGroup table = (ShapeGroup)sh[i];
Shape[] ch = table.getShapes();
for (int j=0; j<ch.length; j++){
if (ch[j] instanceof TextBox){
TextBox txt = (TextBox)ch[j];
String text = txt.getText(); //text in a table cell
}
}
}
}
Creating new tables is not yet supported. It's clear how to implement
it, just need time.
Regards, Yegor
G> Hi,
G> I´ve searched but havent found anything. Can anybody help me on how to
G> extract Tables from PPT using POI.
G> Thnx,
G> Gerson Albuquerque
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/