Bug 41469

Summary: PowerPointExtractor.<init> error
Product: POI Reporter: cqm56 <cqm56>
Component: HPSFAssignee: POI Developers List <dev>
Status: CLOSED WORKSFORME    
Severity: normal    
Priority: P2    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: edit with Microsoft Office 2003

Description cqm56 2007-01-25 19:03:01 UTC
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)
Comment 1 Nick Burch 2007-01-26 04:38:24 UTC
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?
Comment 2 cqm56 2007-01-28 19:11:27 UTC
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;
	}
Comment 3 Nick Burch 2007-01-29 02:48:41 UTC
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.
Comment 4 cqm56 2007-01-29 18:32:51 UTC
Created attachment 19482 [details]
edit with Microsoft Office 2003

I am a chinese user
Comment 5 Rainer Klute 2007-01-29 21:46:48 UTC
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.
Comment 6 cqm56 2007-01-29 22:08:41 UTC
thanks for your solution.