We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Slides for Java (2.4.0): addEmptySlide is working but some stack in the console

Hello,

i am trying to test the aspose slides for java example.
The example works perfectly, but in the console is a stacktrace displayed.
The stacktrace must written to the console with “System.out.print…”, the catch of the example is not called.

Can you please remove this output, otherwise the log file of my application will be full?


Code from the example:

/**
* @param args
*/
public static void main(String[] args)
{
try
{
//Instantiate a Presentation object that represents a PPT file
Presentation pres=new Presentation();

//Adding an empty slide to the presentation and getting the reference of
//that empty slide
Slide slide=pres.addEmptySlide();

//Do some work on the slide
//Writing the presentation as a PPT file
pres.write(new FileOutputStream(new File("C:\\temp\\demo.ppt")));

}
catch(Exception ex)
{
System.out.println("Fehler:" + ex.toString());

}
}

Exceptions:


java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:507)
at java.util.ArrayList.get(ArrayList.java:324)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at x.x.buildPresentationModule.controllers.test1.main(test1.java:35)
java.lang.IndexOutOfBoundsException: Index: 5, Size: 5
at java.util.ArrayList.RangeCheck(ArrayList.java:507)
at java.util.ArrayList.get(ArrayList.java:324)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at x.x.buildPresentationModule.controllers.test1.main(test1.java:35)
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:507)
at java.util.ArrayList.get(ArrayList.java:324)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at x.x.buildPresentationModule.controllers.test1.main(test1.java:35)
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:507)
at java.util.ArrayList.get(ArrayList.java:324)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at x.x.buildPresentationModule.controllers.test1.main(test1.java:35)
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:507)
at java.util.ArrayList.get(ArrayList.java:324)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at x.x.buildPresentationModule.controllers.test1.main(test1.java:35)

Thanks for help
vland

Dear Valand,

I have investigate the stack trace shared by you and it seems to be a minor inconsistency in Aspose.Slides for Java. An issue with ID 20963 has already been created in our issue tracking system to resolve the problem. This thread has also been linked with the issue, so that you may be automatically notified, once the issue is resolved.

We are sorry for your inconvenience,

I also have this problem.

Is there any news concerning this issue ?
Thank you.
Regards.

Hello Dear,

I regret to share with you that I have verified from our issue tracking system and the issue is still unresolved. This thread has already been linked with the issue and as soon as the issue is resolved, you will be automatically notified.

We are sorry for your inconvenience,

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


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

Hello, with aspose slides 2.4, 2.5, 2.6.0.0 I have still this issue.

The stackTrace is polluting my System.err.

This minimal Code:

public class HelloWorldSlide {

public static void main(String[] args) throws AsposeLicenseException,
IOException {

// Instantiate a Presentation object that represents a PPT file
Presentation pres = new Presentation();
Slide slide = pres.addEmptySlide();
File file = java.io.File.createTempFile(“HelloWorldSlide”, “.ppt”);
System.out.println("file written in : " + file.getAbsolutePath());
// Writing the presentation as a PPT file
FileOutputStream fileOutputStream = new FileOutputStream(file);
pres.write(fileOutputStream);
fileOutputStream.close();
}
}

is creating this stackTrace:
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:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at com.efront.poc.aspose.slide.HelloWorldSlide.main(HelloWorldSlide.java:20)
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:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at com.efront.poc.aspose.slide.HelloWorldSlide.main(HelloWorldSlide.java:20)
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:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at com.efront.poc.aspose.slide.HelloWorldSlide.main(HelloWorldSlide.java:20)
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:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at com.efront.poc.aspose.slide.HelloWorldSlide.main(HelloWorldSlide.java:20)
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:230)
at com.aspose.slides.Presentation.do(SourceFile:1492)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1639)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2465)
at com.efront.poc.aspose.slide.HelloWorldSlide.main(HelloWorldSlide.java:20)


Thank you for your answers.


Hello Dear,

I have worked with the code snippet shared by you and have not been able to observe any exception while adding the empty slide and saving the presentation. I am using JDK 1.6.0_21 with Aspose.Slides for Java 2.6.0 for my verification in Windows 7 x64 environment. Can you please share the complete details of environment on your end so that we may try to reproduce the issue on our side. I have shared the presentation generated by using your code snippet as well. Can you please also share that the code snippet that you have shared represents the complete presentation to reproduce the issue on your end or there are some other operations involved as well that you may not have shared with us. If there are some other operations involved then please share a complete working code snippet with us so that we may help you out further.

Thanks and Regards,

Hello, I’ve restarted the project from scrath, and the snippet is now working.


Thank you.

Hello Dear,



That is really nice that things worked for you. Please share if I may provide any further help in this regard.



Thanks and Regards,

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan