IndexOutOfBoundsException cloning slide with master slide

Hi,

Attached are two presentations created in PowerPoint 2003. simple_2003 has a single slide with some text on it, and no elements on the master slide. simple_2003_with_master.ppt is the same but has the default master slide - title text, some bullet points as the body and three footer elements.

The code I’m using is below. When I run it against Aspose Slides 2.3.0 on the presentation without any master elements it works fine. When I run it on the presentation with master elements, I get a series of IndexOutOfBoundsException errors that occur within Presentation.cloneSlide. The errors are underneath the source.

These errors do NOT occur on older versions of Aspose (1.9).

I’m using the Diablo Java JRE build 1.6.0_07-b02 on 32-bit FreeBSD 7.1.

Code
import com.aspose.slides.*;
import java.io.*;
import java.util.TreeMap;

class PptTestCase {
static public void main(String[] args) {
try
{
String templateFile = args[0];
String outFile = “aspose_” + templateFile;
FileInputStream is = new FileInputStream(templateFile);
Presentation srcPres=new Presentation(is);
is.close();
Slide templateSlide = srcPres.getSlideByPosition(1);

Presentation targetPres = new Presentation();
TreeMap tMap = new TreeMap();

int endPosition = targetPres.getSlides().getLastSlidePosition() + 1;
// This throws IndexOutOfBounds (line below is #21)
srcPres.cloneSlide(templateSlide, endPosition, targetPres, tMap);

FileOutputStream os = new FileOutputStream(outFile);
targetPres.write(os);
os.close();
}
catch (Exception e){
System.out.println(e);
e.printStackTrace();
}
finally {}
}
}


Exception:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:225)
at com.aspose.slides.Presentation.do(SourceFile:1479)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1626)
at PptTestCase.main(PptTestCase.java:21)
java.lang.IndexOutOfBoundsException: Index: 5, Size: 5
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:225)
at com.aspose.slides.Presentation.do(SourceFile:1479)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1626)
at PptTestCase.main(PptTestCase.java:21)
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:225)
at com.aspose.slides.Presentation.do(SourceFile:1479)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1626)
at PptTestCase.main(PptTestCase.java:21)
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:225)
at com.aspose.slides.Presentation.do(SourceFile:1479)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1626)
at PptTestCase.main(PptTestCase.java:21)
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:225)
at com.aspose.slides.Presentation.do(SourceFile:1479)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1626)
at PptTestCase.main(PptTestCase.java:21)


Hi Steve,

Thanks for considering Aspose.Slides.

I have verified the working of simple_2003_with_master.ppt with Aspose.Slides for Java 2.3.0 and have been able to reproduce the issue as specified by you. In my observation, the slide gets cloned successfully and the presentation can be saved and viewed as well. However, series of OutOfBoundException is thrown. This issue need to be investigated and an issue with ID 18634 has been created in our issue tracking system to resolve this problem. This thread has also been linked with the issue ID, so that you may be automatically notified, once the issue is resolved.

We are sorry for your inconvenience,

Hi Mudassir,

What about this one ?
We are using the 2.4 version of Aspose slide and are still seeing this error logged: we have tens of thousand lines on our logs because of this.
Is there a mean to at least disable those logs, as it seems the ppt files are still correctly generated ?
Do those error mean that we make something wrong on our side when cloning and building our slides ?

Thanks for your quick answer, as we had to come back to a previous version to get rid of those logging.

Bye,
Popov

Dear Popov,

I regret to share that I have verified from our issue tracking system and feel sorry to share that the issue has not yet been resolved. I have requested the development team to provide any possible ETA for the issue and as soon as some information is shared, I will share that with you.

We are sorry for your inconvenience,

Hi,


Was there any news on this? As popov said, it generates a lot of log noise (and worse, is printing directly to stderr so it’s showing up in our server logs).

Thanks,

Steve

Dear Steve,

I have discussed the issue with our development and feel sorry to share with you that the issue is still unresolved. It is expected to be resolved by the end of this year.

Thanks and Regards,

Hi,


Any update on this issue yet?

Steve

Hi Steve,

The issue shared by you has been resolved. You may please download the hotfix version of Aspose.Slides for Java 2.4.2, which contains the fix for this issue from here. Please share with us, if you feel any issue.

Thanks and Regards,

Thanks for the reply. I tried dropping in the 2.4.2 library and got the following error in the Presentation constructor :

java.lang.NoClassDefFoundError: org/apache/log4j/Priority

I’m running under Jython and the 2.4.0 binary worked fine.


Hello Dear,

You may be missing the attached jar file reference in your project code. Please add the reference of shared jar file.

Thanks and Regards,

The issues you have found earlier (filed as 18634) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.