code: PowerPointExtractor pe = new PowerPointExtractor(getStreamToIndex());//error System.out.println(pe.getNotes()); contents = pe.getText(true , true); System.out.println(contents); Exception: java.lang.ArrayIndexOutOfBoundsException: 8 at org.apache.poi.util.HexDump.toHex(HexDump.java:406) at org.apache.poi.util.HexDump.toHex(HexDump.java:397) at org.apache.poi.hpsf.UnsupportedVariantTypeException.<init> (UnsupportedVariantTypeException.java:46) at org.apache.poi.hpsf.ReadingNotSupportedException.<init> (ReadingNotSupportedException.java:44) at org.apache.poi.hpsf.VariantSupport.read(VariantSupport.java:276) at org.apache.poi.hpsf.Property.<init>(Property.java:162) at org.apache.poi.hpsf.Section.<init>(Section.java:280) at org.apache.poi.hpsf.PropertySet.init(PropertySet.java:453) at org.apache.poi.hpsf.PropertySet.<init>(PropertySet.java:248) at org.apache.poi.hpsf.PropertySetFactory.create (PropertySetFactory.java:60) at org.apache.poi.POIDocument.getPropertySet(POIDocument.java:91) at org.apache.poi.POIDocument.readProperties(POIDocument.java:68) at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:128) at org.apache.poi.hslf.HSLFSlideShow.<init>(HSLFSlideShow.java:94) at org.apache.poi.hslf.extractor.PowerPointExtractor.<init> (PowerPointExtractor.java:84) at lius.index.powerpoint.PPTIndexer.getContent(PPTIndexer.java:72)
Seems to be an error from HPSF, when HSLF loads the properties. Could you attach the problem file to the bug, so some can look into why HPSF isn't liking it?
I don't change properties ,I just writed by prquick-guide.pdf simply. code: public String getContent() { String contents = ""; try { /**error*/ PowerPointExtractor pe = new PowerPointExtractor (getStreamToIndex()); //getStreamToIndex() is InputStream System.out.println(pe.getNotes()); contents = pe.getText(true , true); System.out.println(contents); /**error too*/ /*SlideShow ss = new SlideShow(new HSLFSlideShow (getStreamToIndex())); String text = ss.getSlides()[0].getNotesSheet ().toString(); System.out.println(text);*/ /****** success ****/ /*QuickButCruddyTextExtractor qt = new QuickButCruddyTextExtractor(getStreamToIndex()); contents = qt.getTextAsString(); System.out.println(contents);*/ } catch (Exception ex) { ex.printStackTrace(); logger.error(ex.getMessage()); } return contents; }
Can you attach the document you're working with? You're not changing the properties, but HSLF still tries to load them when you init the HSLFSlideShow object, and the HPSF properties stuff isn't liking your document.
Created attachment 19482 [details] edit with Microsoft Office 2003 I am a chinese user
I cannot see any problems with the document using a) poibrowser to display the properties and b) running the HPSF testcases with the document in question in src/testcases/org/apache/poi/hpsf/data. Please retry with the latest subversion repository snapshot and reopen the bug if necessary.
thanks for your solution.