Free Support Forum - aspose.com

Generat ThumbNails from PPTX on MemoryStream

Hi.

I'm trying to generate thumbnails from a PPTX file uploaded on aspx page.

I'm using the following code and I'm receiving the error : "Parameter is not valid" on line slide.GetThumbnail.

Dim pres As New Aspose.Slides.Pptx.PresentationEx(pptStream)
For iContSlides As Integer = 0 To pres.Slides.Count - 1
Dim slide As Aspose.Slides.Pptx.SlideEx = pres.Slides(iContSlides) ' .GetSlideByPosition(iContSlides)
Dim imagePreview As Drawing.Bitmap = slide.GetThumbnail(290.0F, 230.0F)
imagePreview.Save(imgStream, Drawing.Imaging.ImageFormat.Jpeg)
next

Any help??

My similar code for PPT files is working perfectally.

Dim pres As New Aspose.Slides.Presentation(pptStream)
For iContSlides As Integer = 1 To pres.Slides.Count
Dim slide As Aspose.Slides.Slide = pres.GetSlideByPosition(iContSlides)
Dim imagePreview As Drawing.Image = slide.GetThumbnail(New Size(290, 230))
imagePreview.Save(imgStream, Drawing.Imaging.ImageFormat.Jpeg)

Best regards,

Ésio Nunes

Hi Esio,

Thanks for your interest in Aspose.Slides.

Well, in case of MS PowerPoint 2007 (PPTX) file formats, size feature for slideEx.GetThumbnail() method is not available currently. However, scaling factor can be defined while rendering the slide to the image. For example, in the code sample provided by you, slide.GetThumbnail(1f,1f) will render the slide to an image size equivalent to slide size. An issue for provision of size feature for slideEx.GetThumbnail() has been reported on our Issue Tracking System as 12337. This thread has been linked with the issue so that you can be updated here as soon as this feature is implemented. For more information and work around, please visit this thread.

Thanks and Best Regards