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

Free Support Forum - aspose.com

PPTX to XPS MetaFiles are alwasy saved as PNG

Hello,


I’m trying to save a PPTX file as XPS using one line of code:

new PresentationEx(pathToPptxFile)
.Sa
ve(targetXps, SaveFormat.Xps, new XpsOptions { SaveMetafilesAsPng = false });

As you can see, I want the images to be in its original format, but the images within the XPS are all converted to PNG which makes the XPS a very large file.

Is there another option I have to set?

I’m using a licensed version of Aspose.Slides for .NET 7.4.0.

Thanks in advance.


Hi Daniel,


Thanks for inquiring Aspose.Slides.

I have observed the sample code shared and it seems OK. Can you please share the sample presentation along with generated faulty output with us. Please also share the expected output fore reference. I would recommend you to please try using Aspose.Slides for .NET 7.4.0 on your end before sharing the requested information.

Many Thanks,

Hello,


as I posted before, I already use version 7.4.0.

I’ve attached a zip document, which contains the original PPTX created with Powerpoint 2013, a XPS created with Powerpoint 2013 an a XPS created with Aspose.Slides for .NET 7.4.0 with the code from my original post.

You will notice the difference in file sizes at first. the XPS created with Powerpoint is smaller than the PPTX, but the XPS created with Aspose has more than double size as the PPTX. And compared with the XPS created with Powerpoint the difference is even larger.

This all has only one reason, the file size of the of the image. You can browse the XPS and PPTX with a ZIP program and you can see the following sizes of the images:

PPTX: 777.835 bytes as jpg (this is also the original file size of the image)
XPS Office: 116.055 bytes as jpg
XPS Aspose: 1.832.809 bytes as png

At least, when I set SaveMetafilesAsPng = false the original file shouldn’t be touched, so my XPS with multiple images has a adequate file size.

The possibility to resize the file to its bounds when exporting would be a nice feature, as well as compession options for jpg.

Thanks

Hi Daniel,


I am sorry for the delayed response. I have been able to observe the issue specified and it seems that setting the SaveMetafilesAsPng = false does not seem to work. I have created an issue with ID SLIDESNET-34297 in our issue tracking system to further investigate and resolve the issue. Since, the image is rendered as PNG, so the file size of XPS is grown up. I have also created an issue with ID SLIDESNET-34299 as new feature request to provide support for JPEG compression in XPSOptions class when SaveMetafilesAsPng = false is set. This thread has been linked with the issues so that you may be automatically notified once the issues will be resolved.

We are sorry for your inconvenience,