Ok I guess we need a bit of a step backwards.
My last answer was about what I want to do with Aspose and where the problem was.
The Error is fully reproducable with this sample
Inside the DemoTemplate.pptx is an Folder “customXml” where the CustomXmlParts are stored these Parts are referenced in the SlidePart
when I clone the slide (see:
var slideClone = outPres.Slides.AddClone(slide);)
All the CustomXmlParts are not cloned with it.
My Issue is that the term “AddClone” has the meaning of creating an exact copy of the original. This includes copies of every reference so the two slides are equal.
In my above mentioned sample is also an output.pptx which is created by the contained project by simply cloning the slide.
how you can observed by the missing console output the CustomDataParts are not copied.
You can also see this in the output.pptx the “customXml” folder is but the reference to the customXml inside the picture is still there and the file is still mention in the slide relationships file.
To see yourself what I mean unpack the pptx files and look for the missing parts.
The ISlideCollection.AddClone Method is not working correctly.
Below a Full Sample where you can see and observe the Error I have in all its glory
There is no need for a more complex sample it only distracts from the Problem.
I commented the important parts
public static void Main()
// set your license Pathhere
var licensePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Aspose.Total.lic");
var license = new License();
using (var file = new FileStream(licensePath, FileMode.Open))
using (var inPres = new Presentation())
using (var outPres = new Presentation())
var shape = inPres.Slides.Shapes.AddAutoShape(ShapeType.CircularArrow, 1, 1, 1, 1);
// should obviously be 1
var inCount = shape.CustomData.CustomXmlParts.Count;
outPres.Slides.AddClone(inPres.Slides); // this is where the magic happens, or fails to happen in your case
var outCount = outPres.Slides.Last().CustomData.CustomXmlParts.Count;
// this should also be 1
// this should be true
Console.WriteLine(outCount == inCount);