Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Thu Mar 16, 2023 1:45 pm

Hi,

We're encountering an issue when generating Spire Presentation where there are duplicate themes appearing in the slide.
Image

I have verified that we only have 1 master slide, and there are no duplicate layouts on the master slide.
Would you have any leads on what's causing this issue on the generated powerpoint?

boncyrus
 
Posts: 20
Joined: Wed Mar 01, 2023 10:01 am

Fri Mar 17, 2023 1:58 am

Hi,

We appreciate your feedback and apologize for any inconvenience this issue may have caused.
Unfortunately, the image you attached appears to be damaged and we are unable to view it. Could you please provide us with the following messages to help us investigate further and resolve the problem? You can send them to us via email (support@e-iceblue.com) or attach them here. Thanks for your assistance.
1) your test documents.
2) your full code.
3) the version of Spire. Presentation you are using.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Mar 20, 2023 7:23 am

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.

boncyrus
 
Posts: 20
Joined: Wed Mar 01, 2023 10:01 am

Wed Mar 22, 2023 3:25 am

Hi,

Thanks for your feedback.
After testing, I did not reproduce your issue, the themes are not duplicate. To help us do an accurate investigation, could you please provide us with the following messages? You can send them to us via email (support@e-iceblue.com) or attach them here. Thanks for your corporation.
1) your full test code and documents.
2) your application type, such as Console App .NET Framework 4.8.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Sun Apr 09, 2023 5:03 pm

Hello,

I was able to replicate this using code below

Code: Select all
           
Presentation ppt = new Presentation();
            ppt.LoadFromFile(@"sample.pptx");
            var finalPpt = new Presentation();
            foreach (var slide in ppt.Slides)
            {
                var newPpt = new Presentation();
                newPpt.SlideSize.Type = ppt.SlideSize.Type;

                ISlide clonedSlide = ppt.Slides[0];
                newPpt.Slides.Insert(0, clonedSlide);

                var generatedSlide = newPpt.Slides[0];

               
                finalPpt.Slides.Append(generatedSlide);
            }

            finalPpt.SaveToFile(@"C:\Users\Maine\source\repos\ConsoleApp2\ConsoleApp2\bin\Debug\net6.0\samplenew.pptx", FileFormat.Pptx2013);


There is a duplicate master when appending slides.
Duplicate master.png

This can be replicated using any powerpoint where you append a generated slide.

boncyrus
 
Posts: 20
Joined: Wed Mar 01, 2023 10:01 am

Mon Apr 10, 2023 5:27 am

Hi,

Thanks for your feedback.
After testing, I reproduced your issue and logged it into our issue tracking system with the ticket number SPIREPPT-2227, our developers will investigate and fix it. Sorry for the inconvenience caused. Once the issue is fixed, I will inform you asap.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Apr 13, 2023 1:58 am

Hi,

Thanks for your patience.
After investigating by our development team, it was found that the style of the slide is related to the template. When copying a slide, the template used will also be copied to the new slide. Our new slide defaults to one page and uses a default set of templates, which, when combined with the copied slides, results in two sets of templates. This behavior is also present in PowerPoint and can be tested by creating a new blank PPT document and copying with formatting into another PPT file - the templates from the blank PPT will also be added to the other PPT. So this is not a bug, thanks for your understanding.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Apr 13, 2023 7:18 am

Hi,
In powerpoint, I was only able to replicate this when I have applied formatting / theme and I try to copy that slide and keep source formatting.
However, when it's just a blank slide and the default theme was applied, I do not replicate it.

In spire, I am able to replicate the issue when I use Slide.Append even if I use the default template or have custom formatting. There are always duplicate themes

boncyrus
 
Posts: 20
Joined: Wed Mar 01, 2023 10:01 am

Thu Apr 13, 2023 8:56 am

Hi,

Thanks for your feedback.
When create a new PPT file and copy its empty slide with format to an existing ppt file in PowerPoint, the templates will also be added to another ppt file, see attached picture:
copy.png

In our Spire. Presentation, new slide uses a default set of templates, when copied to other ppt files, the templates were also copied.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Presentation