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

Free Support Forum - aspose.com

Displaying PPTx

I have displayed thumbnails of PPTx files on our sites. If they are small, they are OK. We also have pages where we want to display them at full scale; these are very blurry.

Is there a way to display a single slide PPTx near full size and maintain its best resolution?

I have even considered trying to convert it to pdf and making a jpg from there to display (haven't succeeded).

Dear Brad,

You can set the scaling factor in X and Y direction and can observe visually that up to which scaling factor the blurring effect is not observed. You may also try generating EMF image as well and may be it may prove helpful for you. Please follow this link for further details.

Thanks and Regards,

Hi Mudassir,

I bumped the scaling factor up from 1.0F to 3.0F:

oBitmap = oSlide.GetThumbnail(3.0F, 3.0F)

That improved the display quite a bit. I'd still like to have a way to display a clear full size image (not a thumbnail), but that was a good improvement.

Brad

Dear Brad,

As I mentioned in my earlier post that you may try generating an EMF image and that might prove to have better image quality.

Thanks and Regards,

Hi Mudassir,

I went to the other link where an EMF was used. I did not understand how that would be used to display an existing PPTx file.

Can you give an example of how I would read a single page PPTx and use EMF to display it?

Dear Brad,

Please use the code snippet given below to add the EMF image in PPTX presentation. Please share with us, if you have any further queries.

//Instantiate PrseetationEx class that represents the PPTX

PresentationEx pres = new PresentationEx();

//Get the first slide

SlideEx sld = pres.getSlides().get (0);

//Add autoshape of rectangle type

int idx = sld.getShapes().addAutoShape(ShapeTypeEx.RECTANGLE, 10, 10, 648, 393);

ShapeEx shp = sld.getShapes().get (idx);

//Set the fill type to Picture

shp.getFillFormat().setFillType(FillTypeEx.PICTURE);

//Set the picture fill mode

shp.getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillModeEx.TILE );

//Set the picture

// Instantiate a EmfMetafile/WmfMetafile object that represents a metafile
com.aspose.metafiles.EmfMetafile emf = new com.aspose.metafiles. EmfMetafile(new FileInputStream(new File("D:\\Aspose Data\\MyImage.emf")));

// Creating RenderedImage object for the metafile

RenderedImage image = emf.createDefaultRendering();

ImageEx imgx = pres.getImages().addImage (image);

shp.getFillFormat().getPictureFillFormat().getPicture ().setImage(imgx);

//Write the PPTX file to disk

pres.write("D:\\Aspose Data\\RectShpPic.pptx");

Thanks and Regards,

Hi Mudassir,

Thanks for the code, but I don't understand how that works.

I am trying to display an existing PPTx page on an aspx web page. Currently I am doing that by using the createthumbnail routine. That results in a blurry full scale presentation. I was trying to get a clear full scale picture of the PPTx on my aspx page.

Brad

Dear Brad,

I am sorry for the inconvenience as i mistakenly shared the Java code for adding EMF image in PPTX. Please proceed to this thread link, where by you will find the code snippet for adding EMF image in PPTX shape.

Thanks and Regards,

Hi Mudassir,

I am not trying to insert an EMF in a PPTx. I am trying to display a single page PPTx in an aspx page. When I do that, the image is blurry (using getThumbnail). Increasing the scaling in getThumbnail did help (as noted earlier) but I was looking for a technique which would make the image clear.

Brad

Dear Brad,

I am sorry for the inconvenience. Actually, I have tried to share a work around with you that you may adopt using EMF image and may be it reduces the blurring effect in your application. Unfoirtunately, at the moment there is no other work around available.

Thanks and Regards,