Free Support Forum - aspose.com

ASPOSE.SLIDE for Java 18.12 breaks code


#1

// Set the slide size/dimension of generated presentations to that of source file when cloning
pres2.getSlideSize().setType(pres1.getSlideSize().getType());
pres2.getSlideSize().setSize(pres1.getSlideSize().getSize());

The code above was working fine in the older version of ASPOSE.SLIDE Java, but now broken in the current version, withe error “setType” does not exist com.aspose.slide. It basically take the dimension of cloned deck and set it to the target deck Can you help with this?

Many thanks


#2

@JediJide,

I have observed your requirements and suggest you to please try using following sample code on your end to serve the purpose using latest Aspose.Slides for Java.

public static void mergePresentations()
{

    String path="C:\\Aspose Data\\Presentation\\";

    IPresentation iPresentation=new Presentation(path+"Presentation Global Country Argentina.ppsx");

    IPresentation result=new Presentation();     // this.source = iPresentations;

    final Dimension2D size = iPresentation.getSlideSize().getSize();
    result.getSlideSize().setSize( (int)size.getWidth(),(int)size.getHeight(),SlideSizeScaleType.EnsureFit);
    for(ISlide slide : iPresentation.getSlides())
    {
        result.getSlides().addClone(slide);
    }

    result.getSlides().removeAt(0);
    result.save(path+"Saved.ppsx",SaveFormat.Ppsx);

}

#3

Many thanks, this works. This seems to have changed in version 17.x of the component.


#4

@JediJide,

It’s good to hear that things are resolved on your end. Please feel free to share if there is any further help I may offer to you.