Hello,
Presentation.SlideSize.Type and Presentation.SlideSize.Size are now read only properties.
We encountered the issue when we updated to Aspose.Slides.dll 18.3.0.0
We did not have this problem on the previous version we were using 17.3.0.0
We need to be able to set the size and type of a presentation.
Is there a new way to do this on newer versions fi slides?
I have observed your comments. I have shared sample code with you. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.
Presentation pres = new Presentation(path+“testaspose1.pptx”);
ISlide slide = pres.getSlides().get_Item(0);
try {
pres.getSlideSize().setSize(540, 720, SlideSizeScaleType.EnsureFit); // Method SetSize is used for set slide size with scale content to ensure fit
pres.getSlideSize().setSize(SlideSizeType.A4Paper, SlideSizeScaleType.Maximize); // Method SetSize is used for set slide size with maximize size of content
I like to share that there are 72 pixels / inch unit used in API. so for 720 x 540 is actually 10’’ x 7.5’’ slide size. I hope the shared information will be helpful.
When I set pres.getSlideSize().setSize(640.0f,360.0f,SlideSizeScaleType.EnsureFit);
but I get slide of ppt size is not 640.0f * 360.0f.
like this image2019-11-14_125122.jpg (81.3 KB)
Please provide the working sample code, source file, generated file and desired output. We will investigate the issue further on our end to help you out.
{
Presentation pres = new Presentation();
pres.getSlideSize().setSize(960.0f, 540.0f, SlideSizeScaleType.DoNotScale);
pres.save(“testSlideSize.pptx”, SaveFormat.Pptx);
} testSlideSize.zip (20.2 KB)
I think this slide of file is not I set. Is value I set is wrong? I want 960 * 540 canvas. But I get 1220 * 740.
I have checked your result and its seems you are using old version of Aspose.Slides. Can you please try to use Aspose.Slides latest version 19.10 on your end and share feedback with us if there is still an issue.