Free Support Forum - aspose.com

Cloning slideEx loses box around TextFrameEx and adds bullets to text

Hi,

We recently purchased Total for .Net. I am merging slides, art and titles into output pptx presentations.

When I clone the single slide from the attached file (P-EIN-0013.9.pptx) into a new presentation using the layout from the template file (LessonTemplate.pptx), the box around the text field is not cloned and bullets appear on the text.

Is this a known issue? Is there a way to prevent this from happening?

Brad

Dear Brad,

I am sorry for the delayed response as I am awaiting response from our development team.

I have been able to reproduce the issue as specified by you and I have requested our development team to provide support for the mentioned issue. As soon as some information is shared that whether it's an inconsistency or normal behavior, I will convey to you.

Thanks and Regards,

Dear Brad,

I have received the feedback from our development team. As mentioned earlier that I have been able to observe the same behavior as your have mentioned. Actually, the feature for the managing Layout Slides is unavailable and the feature may be implemented some where in the future. Unfortunately, we cannot promise any time line for the feature. However, the workaround for this is quite simple and you can easily add all necessary shapes directly to a slide without changing the layout.

We are sorry for your inconvenience,

Sorry Mudassir, I do not understand the answer.

I was not trying to manage Layout Slides, I was trying to clone a slide into a new presentation and the clone did not look like the original (it lost its surrounding box and had bullets added (as you saw)). I am under the impression that clones should look the same as the original.

Am I missing something?

Brad

Dear Brad,

I am sorry for the fact if am unable to properly understand your problem. I perceived that you were having problem when you were cloning slide from source presentation and applying the layout of template slide on that. By doing so, I observed the loss of text frame around the shape and addition of bullets to the text inside in the cloned slide. I used the following code snippet to reproduce this fact. Please share some more knowledge, along with the code snippet, if I am unable to properly reproduce your problem.

//Instantiate PresentationEx class to load the source PPTX file

PresentationEx srcPres = new PresentationEx("d:\\ppt\\P-EIN-0013.9.pptx");

//Instantiate PresentationEx class for destination PPTX (where slide is to be cloned)

PresentationEx destPres = new PresentationEx("D:\\ppt\\LessonTemplate.pptx");

//Clone the desired slide from the source PPTX to the end of the collection of slides in //the destination PPTX

LayoutSlideEx Layout = destPres.Slides[4].LayoutSlide;

SlidesEx slides = destPres.Slides;

slides.AddClone(srcPres.Slides[0]);

slides[slides.Count - 1].LayoutSlide = Layout;

//Write the destination PPTX to disk

destPres.Write("d:\\ppt\\helloworld_dest.pptx");

Thanks and Regards,

Hi Mudassir,

From your code and all your responses, I think you understand the problem. I don't understand the previous answer 'Actually, the feature for the managing Layout Slides is unavailable'. I don't know how this problem relates to managing Layout Slides.

Anyway, I have done a work-around for that particular problem (by copying the single autoshapeex textframeex info). That has fixed the little problem.

There is still the 'why does cloning drop the box and add bullets' problem. We are trying to clone other slides with more complex pptx pages. I suspect that we will have some of those that will have boxes dropped and bullets added; would be nice to know that won't happen.

Your test code is very similar to what I was doing and did produce the same problem. I actually did the cloning and layout with one call which would be:

slides.AddClone(srcPres.Slides[0], Layout);

in your code, but the result was the same loss of box and addition of bullets.

Brad

Hi Brad,

The problem comes when you use Layout slide in cloning. Actually, when you add Layout slide in AddClone() method, it means you are applying that Layout slide on the cloned slide. The method is implemented, however the Layout slides are not yet managed in Aspose.Slides. That is why, you observe the loss of text frame boundary and addition of bullets effect in the cloned slide. If you please use following code line for cloning, you will observe that the cloned slide will be similar to source slide.

slides.AddClone(srcPres.Slides[0]);

Thanks and Regards,

Hi Mudassir,

Interesting, I would not have guessed that the layout slide would be the problem. I guess the workaround will stay for a while. Hope we don't have other slides that cause the problem.

In an earlier post you said 'the workaround for this is quite simple and you can easily add all necessary shapes directly to a slide without changing the layout'. I have made routines to 'clone' the TextFrameEx object. It has not been easy for me for just that one. It would be nice if there were routines that cloned all the different types of shapes, but I can tell from just the one that it would take a big effort to do that.

In any case, we are moving forward.

Brad