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

Free Support Forum - aspose.com

PPT clone

How to clone a presentation using Aspose Slides for Java?

Looking for best way.



Some ideas I have -

Create a byte[] and load Presentation object with byte[].

Use Aspose clone API which seems to be not working?

Doing clone of individual slides, but I understand we will leave masters and other things.


Which method will take lesser time? Is there some better way?


Thanks in advance.

Hi Praneeth,


Thank you for your interest in Aspose.Slides.

I have observed your comments and like to request you to please visit this link for your kind reference. If you clone a slide from one presentation to another then the respective master is also copied and is not lost. Cloning a slide will not leave masters and other things. Cloning the slides is the most efficient way.

I hope this will clarify the concept. Please share if I may help you further in this regard.

Best Regards,

If there is no slide in the ppt, how this would work?

Hi Praneeth,


I have observed your comments and like to share with you that if there is not any slide in a presentation then you can not create a copy of that presentation using Aspose.Slides.

I hope this will clarify the concept. Please share if I may help you further in this regard.

Best Regards,

#1. What is your reasoning behind it? I know if there is no slide then it doesn’t mean slide is not valid, it contains some masters and layouts. I do want the presentation clone in this case. If you can’t create a clone please add as a BUG or feature enhancement request.

#2. Even let’s assume I’ve some slides, and cloning them will add only used masters and layouts at any time. What will happen to unused masters and layouts?


I hope this will clarify the question.

Thanks

Hi Praneeth,

I have observed your comments and like to share that when you clone the slide from source to target presentation, the slide is cloned along with its used master from source slide to target presentation.

Secondly, even if there is no slide available in your presentation and the still you can clone the master from source to target presentation independently. Please visit this documentation link to see how to clone the master from source to target presentation. When you clone the master, it gets cloned with its Layout slides from source presentation.

Moreover, there is no approach available to clone entire presentation in one go. The available approach is to clone independent slides from source to target presentation.

Many Thanks,

I don’t know where we’re mismatching in opinions. Cloning is about creating the copy of original object. Its dictionary meaning is : “make an identical copy of“.

First of all if you try cloning n slides and add them at destination power-point using Aspose, there will be n slide masters added at destination. master-layout, 1_master-layout, 2_master-layout, and so on up to n. Is this what you mean by clone?

Hope you understand.

Hi Praneeth,


I have further observed your comments and like to share whenever you clone a slide from source presentation to destination presentation by applying master, it will not create a copy of master in target presentation. Please observe the part of following sample code available over this documentation link. You can observe that first we are cloning the master from source presentation to target presentation. Then while cloning normal slide from source to target presentation, you need to apply the cloned master in addClone() method. This way only one master will be cloned. Additionally, please call the following line before saving the presentation. I hope this will be helpful.

destPres.getMasters().removeUnused(true);

Moreover, even if you are cloning slides from same presentation having same masters, there will be one copy of master in target presentation instead of n copies. If you are able to reproduce this issue please share the source presentation, working sample code and generated presentation. I will observe the issue further on my end to help you out.

Many Thanks,