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.

Sun Oct 03, 2021 7:53 pm

Hello,
I am trying to get the effective background of a slide from a presentation file. if the slide has a custom background, it works fine. but if the slide uses theme's background, I'm not able to get the effective background properly. Is there a way to do that?

Thanks,
Arbi

rb_stepanian
 
Posts: 9
Joined: Sun Oct 03, 2021 7:47 pm

Mon Oct 04, 2021 7:14 am

Hi Arbi,

Thanks for your inquiry.

To help us investigate your issue more accurately, please provide your PPT file that uses theme's background. You could upload it here or sent it to us (support@e-iceblue.com) via email. Thanks.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Oct 04, 2021 9:21 am

HI Rachel,

Thanks for the quick reply.
I uploaded a sample pptx file. I just need to be able to get either one picture, or one solid color or one gradient fill for the background of each slide.

Thanks,
Arbi

rb_stepanian
 
Posts: 9
Joined: Sun Oct 03, 2021 7:47 pm

Mon Oct 04, 2021 9:37 am

Hi Arbi,

Thanks for your sharing.

I did some tests with your files and did find that it is not possible to get the background style of the slides. I have posted this issue to our Dev team with the ticket SPIREPPT-1699 for further investigation.

If there are any updates, we will let you know. Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Oct 04, 2021 10:11 am

Thanks for your reply. Please keep me posted on this issue. this is really crucial to my project.

Regards,
Arbi

rb_stepanian
 
Posts: 9
Joined: Sun Oct 03, 2021 7:47 pm

Tue Oct 05, 2021 3:00 am

Hi Arbi,

Thanks for your response.
We will keep you informed as soon as there is any update.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Fri Nov 12, 2021 10:34 am

Hi Arbi,

Thanks for your patience.

Glad to inform you that we just released Spire.Presentation Pack Hotfix Version:6.11.2 that supports getting slide background style that uses theme's background.

Please download the new version from the following links and refer to the sample code for testing.

Website link: https://www.e-iceblue.com/Download/down ... t-now.html
NuGet link: https://www.nuget.org/packages/Spire.Pr ... ion/6.11.2

Sample code:
Code: Select all
            Presentation presentation = new Presentation();
            presentation.LoadFromFile(@"Presentation2.pptx");
            ISlide sld = presentation.Slides[0] as ISlide;
            FillFormat bg = sld.DisplaySlideBackground.GetBackgroundFillFormat(sld as ActiveSlide);


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Nov 12, 2021 5:09 pm

That's great news, thanks Rachel.

rb_stepanian
 
Posts: 9
Joined: Sun Oct 03, 2021 7:47 pm

Mon Nov 15, 2021 1:05 am

You are welcome.

If you have any other questions, just feel free to contact us.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Apr 01, 2022 12:11 am

Hi Rachel,

I tried your solution with version 7.2.0
and I've go a grayscale background image.

FillFormat bgFill= ppt.Slides[i].DisplaySlideBackground.GetBackgroundFillFormat(ppt.Slides[i] as ActiveSlide);

if (bgFill.FillType == FillFormatType.Picture)
{
Bitmap image = bgFill.PictureFill.Picture.EmbedImage.Image as Bitmap;
}

I uploaded the powerpoint file and the saved background picture.

Thanks,
Arbi

rb_stepanian
 
Posts: 9
Joined: Sun Oct 03, 2021 7:47 pm

Fri Apr 01, 2022 11:15 am

Hello,

Thanks for your inquiry.
After analyzing, we found that the background image in your ppt file was recolored by other colors, as shown in the attached screenshot. Sorry currently our Spire.Presentation does not supports getting such recolored background image. Anyway, I have posted this issue to our Dev team using the ticket SPIREPPT-1904. They will further investigate it and check if there is any solution. I will notify you as soon as there is any progress.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 194
Joined: Mon Dec 27, 2021 2:23 am

Wed Apr 20, 2022 8:08 am

Hi Arbi,

Thanks for your patience.
Greetings from E-iceblue.
Glad to inform you that we just released Spire.Presentation Pack Hotfix Version:7.4.5 which fixes the issue SPIREPPT-1904.

Please download the new version from the following links and refer to the sample code for testing.

Website link: https://www.e-iceblue.com/Download/download-presentation-for-net-now.html
Nuget link: https://www.nuget.org/packages/Spire.Presentation/7.4.5

Sample code:
Code: Select all
Presentation presentation = new Presentation();
presentation.LoadFromFile(inputFile);
ISlide sld = presentation.Slides[0];
Image image = sld.SaveDisplayBackgroundAsImage();
image.Save(outputFile, System.Drawing.Imaging.ImageFormat.Png);
presentation.Dispose();


Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 194
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.Presentation