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

Free Support Forum - aspose.com

Serialize slide shape

we have upgraded to the latest version of the aspose dlls and many things no longer work. one of them is the serialization of a shape. for example...

(marker is a new instance of memorystream)

slide.Shapes[i].Serialize(marker);

the shape needs to be saved as svg, not image.

any help?

Hi,


I have observed the requirement shared by you and it seems that you are using the old API version of Aspose.Slides. The old API is no longer supported. Please try using Aspose.Slides for .NET 14.9.0 on your end by using the sample code shared over this documentation link. We have now Shape cloning feature instead of Serialize in new API.

Many Thanks,

thanks for your response.

yes we have upgraded to the latest version of aspose. we currently pull the shape from one slide, put it into memory, and use on a second slide. what we need to reinvent here is a way of taking a shape from one slide and use it in a different slide.

can you help me out with this?

thanks mr. fayyaz.

Hi,

Thank you for sharing the further feedback.

I like to share that the shape cloning feature allows you to copy shape from one slide to another as well. All you need is to use the Shape collection of different slide. The following sample code will serve the purpose for what you are looking for. I hope this will be helpful.

public static void testCloneShape()
{
Presentation pres = new Presentation(“D:\Aspose Data\TestCloneShape.pptx”);

ISlide slide1 = pres.Slides[0];
ISlide slide2 = pres.Slides[1];

IShape srcShape = slide1.Shapes[0];
IShape newShape=slide2.Shapes.AddClone(srcShape);
pres.Save(“D:\Aspose Data\TestCloneShape2.pptx”, SaveFormat.Pptx);
}

Many Thanks,

Thank you for the response Mr. Fayyaz.

The last thing will be how do I position an existing shape on a slide?

in your example above, how would I position the shape "newShape" at a certain coordinate, like (100,200)?

thanks again

- bob

Hi Bob,

Please visit this documentation link for further details. You will find different overloaded methods for AddClone() methods for cloning shapes. The one requested by you is also available there.

Many Thanks,