Hi,
Here are some additional details:
Our generated powerpoints have duplicate slide master themes like this
duplicate slide master themes.png
Here is a sample generated powerpoint with the duplicate master theme:
duplicate master theme.zip
Spire version: This occurs in both Spire.Presentation 7.8.0 and 8.2.0
We have an original powerpoint file. We create a new powerpoint file, copy the settings, and generate the correct slides for the new file.
Sample code snippet:
- Code: Select all
using (var templatePresentation = new Spire.Presentation.Presentation())
{
var templateList = new Presentation();
var templatePresentationItem = new Spire.Presentation.Presentation();
templatePresentationItem.LoadFromFile(filePath);
templateList = templatePresentationItem;
templatePresentationItem.Dispose();
templatePresentation.LoadFromFile(filePath);
var presentation = new Spire.Presentation.Presentation();
presentation.Slides.RemoveAt(0);
for (int i = 0; i < presentation.Masters.Count; i++)
{
presentation.Masters.RemoveAt(i);
}
for (int i = 0; i < templatePresentation.Masters.Count; i++)
{
presentation.Masters.AppendSlide(templatePresentation.Masters[i]);
}
//Code to generate presentation slides
presentation.SaveToFile(filePath, fileFormat);
presentation.Dispose();
}
I was able to verify that both presentation and templatePresentation has only 1 master slide and there are no duplicate layouts in their respective master slides.
Login to view the files attached to this post.