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

Free Support Forum - aspose.com

Please Provide a Quick Example

We’ve been using aspose.slides for Java for quite a while and are very pleased. However, we’ve just begun attempting to open a PowerPoint 2007/2008 file and are having trouble even getting the file open. We just loaded version 1.9.1 JAR file and are attempting to create the object: com.aspose.slides.PresentationEx

We are getting Object Instantiation Exceptions.

Would you be so kind as to provide an example or point us to a Programmers Guide to help getting started with the PresentationEx constructor?

A PHP example would work best.

Thanks!

Hello,

This is how you instantiate the PresentationEx constructor in JAVA

String sourceName="c:\\source.pptx";

PresentationEx sourcePres=new PresentationEx(sourceName);

Where did you download the 1.9.1 version from?

We downloaded from:
http://www.aspose.com/community/files/51/file-format-components/aspose.slides/default.aspx

The link said it was 1.9.0 but when unzipped the jar file name is: aspose-slides-1.9.1.jar

Is this right?


I aplogize but we’re still having an issue. I’m sure it’s something simple. We are a ColdFusion shop and traditionally have opened PPT files like so:


<cfset fistream = PPTFile.init(JavaCast(“string”,templateFilePathAndName))>
<cfset presObjRet.pres = CreateObject(“java”, “com.aspose.slides.Presentation”).init(fistream)>

I see PresentationEx takes a file path string rather than a FileInputStream. So we’ve been trying the code similar to:

<cfset fileString = CreateObject(“java”, “java.lang.String”).init(templateFilePathAndName)>
<cfset presObjRet.pres = CreateObject(“java”, “com.aspose.slides.PresentationEx”).init(fileString)>

The error we’re getting is:
Object Instantiation Exception.
An exception occurred when instantiating a Java object. The class must not be an interface or an abstract class. Error: ‘’.

Ideas?

Quick update. We are able to instantiate the object with:
<cfset presObjRet.pres = CreateObject(“java”, “com.aspose.slides.PresentationEx”)>

However, we haven’t been able to get it to load any files. Again, we get the error listed in the previous posting. The file we’re testing has 3 simple slides. None are empty. It was created in Office 2008 on a Mac…does that matter?

Got it.

Re-saved the file on a PC as Office 2007 and was able to load it. Is Aspose not able to load Macintosh Office 2008 files?

For reference:
<cfset presObjRet.pres = CreateObject(“java”, “com.aspose.slides.PresentationEx”)>
<cfset presObjRet.pres.init(templateFilePathAndName)>

Me again.

Is the getThumbnail method not available for reading Office 2007 files? I found this forum posting:
Cannot open pptx files from Office 2007

It was last updated in April 2008. Are there any updates as to when this feature will be available?

Unfortunately, to provide this feature, Aspose.Slides needs to fully parse the pptx file, so lot of work is needed. The team is working on it and it could take months, the tentative timeline is April.

As yet, Aspose.Slides provides cloning of pptx slides, but that too needs to be fixed in JAVA version which will be fixed in a couple of weeks.