Free Support Forum - aspose.com

Error uploading presentations

We have downloaded latest version for Aspose.slide for Java

aspose-slides-2.2.0-20100328.jar

Now we are not able to upload any presentation.

Caused by: com.aspose.slides.PptEditException: Slide cloning error.

at com.aspose.slides.Presentation.cloneSlide(SourceFile:1525)

at com.aspose.slides.Presentation.cloneSlide(SourceFile:1557)

... 55 more

Caused by: java.awt.HeadlessException

at sun.awt.HeadlessToolkit.getScreenResolution(HeadlessToolkit.java:217)

at com.aspose.slides.TextLayout.measureString(SourceFile:1125)

at com.aspose.slides.TextLayout.layoutText(SourceFile:255)

at com.aspose.slides.TextLayout.(SourceFile:126)

at com.aspose.slides.TextFrame.new(SourceFile:728)

at com.aspose.slides.Shape.char(SourceFile:2150)

at com.aspose.slides.Rectangle.char(SourceFile:205)

at com.aspose.slides.Shape.boolean(SourceFile:2276)

at com.aspose.slides.Presentation.if(SourceFile:3300)

at com.aspose.slides.Slide.do(SourceFile:523)

at com.aspose.slides.Presentation.do(SourceFile:1450)

at com.aspose.slides.Presentation.cloneSlide(SourceFile:1521)

... 56 more

This was not happening until we integrated this new version. We are using aspose-slides-2.1.0.0-20091222.jar with no issues. We wanted to get latest fixes.

Hi Aleksandr,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for considering Aspose.Slides.

In order to reproduce and further investigate the issue, I need the source presentation that is throwing the said exception while cloning. Please share the presentation file along with the code snippet. Please further elaborate the problem as well. We are really committed to help you out and need your cooperation.

Thanks and Regards,

Here is a code snippet - java method
private static void cloneSlide(Presentation from, int slidePosition, final Presentation to) throws PptEditException {
final Slide srcSlide = from.getSlideByPosition(slidePosition);
final int newSlidePosition = to.getSlides().getLastSlidePosition() + 1;

from.cloneSlide(srcSlide, newSlidePosition, to, new TreeMap());
}
I have created 1 page presentation with pretty much title and nothing else. See it attached.

The same works just fine when using prior version of aspose.slides for java.

azarets:
Here is a code snippet - java method
private static void cloneSlide(Presentation from, int slidePosition, final Presentation to) throws PptEditException {
final Slide srcSlide = from.getSlideByPosition(slidePosition);
final int newSlidePosition = to.getSlides().getLastSlidePosition() + 1;

from.cloneSlide(srcSlide, newSlidePosition, to, new TreeMap());
}
I have created 1 page presentation with pretty much title and nothing else. See it attached.

The same works just fine when using prior version of aspose.slides for java.

We are using Java 1.4. not sure if that m akes any difference.

Hi Aleksandr,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have tried to reproduce the problem as specified by you and observed that the source presentation that you are using is actually problematic. Actually, you are using a PPTX file which is renamed as a PPT. Please resave the PPTX file to correct PPT format from MS PowerPoint and then use that with your code snippet.

Thanks and Regards,

Sorry for providing you with bad presentation. All of our presentations are started in Office 2007 as pptx and are saved as ppt. This totally works with version 2.1 of Aspose.Slides for Java. Once we have aquired version 2.2 none of the presentation work.

Please see new attached file. I tried this one with no issues using 2.1. Updated 2.2 jar and get this error

java.awt.HeadlessException

at sun.awt.HeadlessToolkit.getScreenResolution(HeadlessToolkit.java:217)

at com.aspose.slides.TextLayout.measureString(SourceFile:1125)

at com.aspose.slides.TextLayout.layoutText(SourceFile:255)

at com.aspose.slides.TextLayout.(SourceFile:126)

at com.aspose.slides.TextFrame.new(SourceFile:728)

at com.aspose.slides.TextFrame.do(SourceFile:104)

at com.aspose.slides.Rectangle.do(SourceFile:137)

at com.aspose.slides.Slide.getThumbnail(SourceFile:1316)

at com.aspose.slides.Slide.getThumbnail(SourceFile:1195)

Hi Aleksandr,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have worked on your newly provided presentation and successfully generated the clone slide without any exception. I have used the same code snippet provided by you with Aspose.Slides for Java 2.2.0. Please find the output presentation file in attachment for your reference.

Thanks and Regards,

This issue was resolved by migrating to java 1.5.

Just want to let everyone know.

Thanks,

Alex.

Sorry to say but this issue is back for us. It is now a little more complicated. 2.2 version runs successfully on my local computer with no errors but when we deploy it on to the Sun server error comes back again.

java.awt.HeadlessException
at sun.awt.HeadlessToolkit.getScreenResolution(HeadlessToolkit.java:189)

We have tried setting java.awt.Headless=true but it did not help. As I understand this needs to be set on servers that run headless suchas as no mouse, keyborad and so on.

Are we missing some other special settings?

We are running Websphere 6.1 if that helps.

Hi Aleksandr,

We are sorry for the delayed response but we are working on your issue. Our development team is looking in to your issue and we will respond to you ASAP the issue is resolved.

We are sorry for your inconvenience,