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

Free Support Forum - aspose.com

Extracting Thumbnails using ColdFusion

Hi,
my goal is to convert a PPT and PPTX file to images. Each slide should be output as an image in the same size as the original slide. I am using ColdFusion and .NET Aspose components.
I’ve got various versions of .NET installed on the system.

I’ve managed to successfully invoke the dll like this:


<cfset presentation.init("#Expandpath(’./’)#ppt\test1.ppt")>


I can also get the page count for the PPT file like so:




I can also convert one slide to a Bitmap (according to the Aspose docs, that’s
what getThumbnail does > http://www.aspose.com/documentation/.net-components/aspose.slides-for-.net/creating-slide-thumbnail-image-1.html):




<cfset img = slide1.GetThumbnail(1, 1)>



This is where I get stuck. If I write out this Bitmap using CFFILE it results in a 24 byte image which is not recognised as a JPG by my computer. It’s also obviously too small.
Specifying something like
<cfset img = slide1.GetThumbnail(100, 100)>


results in an error.

I’m also unsure as to how to pass an instance of the Size class to the GetThumbnail method.
I was unable to locate the class reference, I tried

and

and


As you can tell, .NET is a bit new to me. If you could provide some tips I’d much appreciate it.

Regards,

Stefan







Regards,



Stefan


Dear Stefan,

I have tried to understand the issue specified by you. if you specify the image size using following statement, it means you are actually scaling the actual slide thumbnail to 100 times in X,Y direction. The resultant image will be of 72000 x 54000 dimension. If 24 bit color scheme is use then the resultant image produced will be of 87 MB approx and it need large memory space during rendering. That is why you are obtaining error with following statement.

You may try using smaller scaling factors and hopefully things may work for you.

Thanks and Regards,

Thank you, I will give that a try.