Hi,

Using your example below, I was able to identify the number of cells
correctly, but the text is not coming, when I ask the length of the array of
RichTextRuns from the text boxes, it returns 0 (Zero).

Do you know why this can be happening, and a possible solution?

Thnx again,


Gerson Albuquerque

-----Mensagem original-----
De: Yegor Kozlov [mailto:[EMAIL PROTECTED] 
Enviada em: segunda-feira, 14 de agosto de 2006 11:26
Para: POI Users List
Assunto: Re: Extracting Tables from PowerPoint

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 haven’t 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/







_______________________________________________________
Você quer respostas para suas perguntas? Ou você sabe muito e quer compartilhar 
seu conhecimento? Experimente o Yahoo! Respostas !
http://br.answers.yahoo.com/

---------------------------------------------------------------------
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/

Reply via email to