poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mihali A. Felipe" <mihali.fel...@yale.edu>
Subject Re: HSLF getting text from each slide in sequence
Date Thu, 04 May 2006 14:52:38 GMT

On Thu, 4 May 2006, Nick Burch wrote:

> On Sat, 29 Apr 2006, Mihali A. Felipe wrote:
> If you can find another open source powerpoint reader (that isn't OpenOffice, 
> since that has brain hurting code) that does get the slides in the right 
> order, can you let us know? We can then take a look through their code, and 
> try to figure out what record / records are used for the slide ordering.

Sure thing. Probably unrelated but this simple code chokes on the same 
powerpoint file but handle some others okay.

//-----------------------------------------------------
import org.apache.poi.hslf.extractor.PowerPointExtractor;
public class Main {
     public Main() {
     }
     public static void main(String[] args) {
         try{
        PowerPointExtractor fn = new PowerPointExtractor (args[0]);
       String test = fn.getText();
       System.out.println(test);
         } catch (java.io.IOException junk) { System.out.println("Error caught");
         }
     }
}
//-----------------------------------------------------

[Development]$ ~/Library/java/jdk1.5.0_06/bin/java Main talk2.ppt
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 
-285217024
         at 
org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:491)
         at 
org.apache.poi.util.LittleEndian.getUShort(LittleEndian.java:64)
         at 
org.apache.poi.hslf.record.Record.findChildRecords(Record.java:94)
         at 
org.apache.poi.hslf.HSLFSlideShow.readFIB(HSLFSlideShow.java:173)
         at 
org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:102)
         at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:85)
         at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:72)
         at 
org.apache.poi.hslf.extractor.PowerPointExtractor.<init>(PowerPointExtractor.java:73)
         at Main.main(Main.java:32)

>> P.S. Why does getSheetNumber() keep giving me -1?
>
> On a recent SVN checkout, it should give you one higher than the slide's 
> position in the array of slides. Are you sure you have a recent enough copy 
> of POI?

Probably not. I'm using poi-3.0-alpha1-20050704.jar and the corresponding 
scratchpad.

Thanks!

- Mihali

----
.  Mihali A. Felipe
.  Gerstein Lab : Bioinformatics
.  Yale University Molecular Biophysics and Biochemistry
.  203-432-6337


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Mime
View raw message