You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Lokesh <lo...@cspl.com> on 2006/11/15 16:18:35 UTC

Need help on ppt

Hi,

I am new to poi.
I have got ppt and I need to update the notes text using poi.

Here is the code what I did.

SlideShow ss = new SlideShow(new HSLFSlideShow("slideshow.ppt"));
Notes[] notes = ss.getNotes();
for (int i = 0; i < notes.length; i++) {
  TextRun[] tr = notes[i].getTextRuns();
  for (int j = 0; j < tr.length; j++) {
	String tempStr = tr[j].getRawText();
	tr[j].setText(tempStr + " Lokesh #### "); // updating the note's text
  }
}
FileOutputStream out = new FileOutputStream(new File("slideshow1.ppt"));
ss.write(out);
out.close();

I am able to see slidshow1.ppt, but when I am opening I am getting the 
following error "PowerPoint can't open E:\slideshow1.ppt because part of the 
file is missing".

If any one has come across such problem and solved it. plz help me where I went 
wrong.

Thanks in advance.
:Lokesh


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


Re: Need help on ppt

Posted by Nick Burch <ni...@torchbox.com>.
On Wed, 15 Nov 2006, Lokesh wrote:
> I am able to see slidshow1.ppt, but when I am opening I am getting the 
> following error "PowerPoint can't open E:\slideshow1.ppt because part of 
> the file is missing".

I'd first try changing the notes text to something of the same string 
length, but just different text. That'll tell us if it's an issue with 
updating the string, or with changing the length of the string.

(PowerPoint has a nasty habbit of embeding absolute byte offsets into 
various points in the file. We think we know about all of them, and update 
them as needed, but it's possible that there's one we're missing)

Nick

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