Using Java License


I can’t seem to get the license to work from within ColdFusion. I can run a sample outside of ColdFusion and it almost works (I still get a blank slide when creating thumbnails which doesn’t exist in the original presentation). However, as soon as a run the sample from within ColdFusion I get the watermark. FYI, ColdFusion runs as a J2EE web app under the JRun server. Any ideas on why this may not be working?




Dear Nathan,

If I’m not mistaken you didn’t write about blank slides yet. I will check it.
Could you provide little more information about license problem please.
Does it throw any exceptions? Any messages in ColdFusion or JRun logs?



As for blank slides, when I get a Slides collection using the Presentation’s getSlides method, the size of the collection seems to be one larger than the actual number of slides. When I loop over the collection this gives me one “blank” slide. I thought this may have been a “feature” of the evaluation to ensure one watermarked slide was in a presentation, but I guess this is not the case?

As for the license, I don’t see any errors in the ColdFusion or JRun logs. The code that loads the license is in a try block which throws a custom error, but I’m not seeing the custom error thrown either.




Dear Nathan,

If you read wiki and forum you should know Aspose.Slides can’t work with empty presentations (without slides)
and even when you create presentation from scratch it always has one empty slide. You have to delete this slide
when finished work with presentation.

Another thing explained many times in the forum is getSlides() collection contains not only normal slides but also
title master slides. For standard work you shouldn’t access slides by index with function get().
There are special functions to access normal slides: Slides.getLastSlidePosition() and Presentation.getSlideByPosition().
Also you should never delete slides by index like getSlides().remove(1).
Always use something like this: getSlides().remove(pres.getSlideByPosition(1))

If you don’t see any errors on license loading then it works.
I have found in the google comments that ColdFusion can’t work with static class members. Is it true?
When you call setLicense method license stored in the static member. Can it be a problem with ColdFusion?


Hello Alexey,

Yes, I found some posts on the getSlides() collection and was able to correct the issue. I’m now looping over the slides collection and checking the slide position via getSlidePosition() before processing. I’m only processing slides with a position greater than 0. (I’m guessing I could also use the
isMasterSlide() method, but the slide position test works.)

I guess the confusion stems from the API documentation, which does not mention the fact that getSlides() returns masters. Looking at the API this is not obvious because the Presentation object also has a getMasters() method.

As for the license issue, it turns out there was an old version of the code which we were using for evaluation still on the classpath. I removed that package and it seems to be working now.

Thanks for all the help with this.