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

Free Support Forum - aspose.com

Pptx to Image Not working properly



Dear All,
I am new to Aspose,

I was trying to convert one of my pptx file to a jpg image.
I found some sample code from the Aspose site.I downloaded the requirements.

Please see my codes below.

try{

PresentationEx pres = new PresentationEx(“D://EmbeddedObject_excel.pptx”);
//Access the first slide
SlideEx sld = pres.getSlides().get(1);
//Create a full scale image
BufferedImage img = sld.getThumbnail(1f, 1f);
//Save the image to disk in JPEG format
ImageIO.write(img, “JPG”, new File(“D://Sample.jpg”));
} catch (IOException e) {
e.printStackTrace();
}

From the above code i got a jpg file.But it doesnt contain my required ppt. instaed it contain a green colour rectangular box.

Dint get why it is coming like that,
Your extreme help will be appreciated,

Thanks.

Hi Shajeer,

Thanks for considering Aspose.Slides.

I am afraid, you may be missing reference to JAI and JAI Image I/O jar files. Please proceed to this documentation link and add these jar files reference in your source project. If the problem still persists then please share the source presentation file, so that we can help you further.

Thanks and Regards,



After adding the jar references to the source project still it displays the same colour box.
Please find attached my input as test.pptx powerpoint file and my output as i got after compiling the below code as Sample.jpg.

I need an exact image of the ppt. Sometime my ppt will contain more than one slides.So the output woluld be like Sample1.jpg,Sample2.jpg etc.



Please find below Code,

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import com.aspose.slides.pptx.PresentationEx;
import com.aspose.slides.pptx.SlideEx;

public class PPTTest {

public static void main (String[] args) throws Exception {
try{

PresentationEx pres = new PresentationEx(“D://test.pptx”);
SlideEx sld = pres.getSlides().get(0);
BufferedImage img = sld.getThumbnail(1f, 1f);
ImageIO.write(img, “JPG”, new File(“D://Sample.jpg”));
} catch (IOException e) {
e.printStackTrace();

}
}
}

Thanks for your help.

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

I have been able to verify the issue as specified by you and it seems to be an inconsistency in Aspose.Slides for Java. An issue with issue id 15523 has been created in our Issue Tracking System to resolve the issue. This thread has also been associated with this issue, so that you can be automatically notified as soon as this issue is resolved.

We are sorry for your inconvenience,

I’m also seeing the exact same issue–replying so I’m notified when it’s updated.

I have reported same issue several mounth ago but still have no solution.

Dear All,

Our development team is working hard on resolving the issue. We will be very happy to share the findings with you, as soon as the issue is resolved.

We are sorry for your inconvenience,

The issues you have found earlier (filed as 15523) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.