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 Feb 03, 2022 8:47 am

Hi,
When i try to save presentation i get the error below.

Code: Select all
Exception Message:Object reference not set to an instance of an object., StackTrace:   at spr⑟.ᜂ()
   at spr⑟.ᜀ(sprᢝ A_0)
   at Spire.Presentation.Collections.ShapeList.ᜀ(sprᢝ A_0)
   at Spire.Presentation.GroupShape.PptxPrepareForSaving(sprᢝ saveContext)
   at Spire.Presentation.ActiveSlide.PresentationBeforeSave(sprᢝ saveContext)
   at spr᝟.ᜀ(sprᢝ A_0)
   at spr᝙.ᜀ(sprᢝ A_0, sprᜪ A_1)
   at spr᝙.ᜀ(Stream A_0, sprᜪ A_1, spr᪮ A_2)
   at spr᝙.ᜀ(Stream A_0, spr᪩ A_1, spr᪪ A_2)
   at spr᝙.ᜀ(String A_0, spr᪩ A_1)
   at Spire.Presentation.Presentation.SaveToFile(String file, FileFormat fileFormat)
   at SlideBuilder.Generator.Domain.Services.SlideGenerator.GeneratePresentation(String presentationType, Byte[]& presentationFile, String& fileName, String& presentationFilePath, Int64& templateFileSizeInBytes, String& errorDescription) in /src/Microservices/Domain/SlideBuilder.Generator.Domain/Services/SlideGenerator.cs:line 292 Slide Index:0


Source Code:
Code: Select all
            //Load template presentation
            Presentation templatePresentation = new Presentation();
            templatePresentation.LoadFromFile("crashes-app.pptx");

            //Create New Presentation
            Spire.Presentation.Presentation presentation = new Spire.Presentation.Presentation();
            presentation.Slides.RemoveAt(0);

            //Create Temporary Blank Presentation
            var blankPresentation = new Spire.Presentation.Presentation();

            //Get slide from template presentation. index:1
            ISlide cloneSlide = templatePresentation.Slides.ToArray().ElementAtOrDefault(1);

            //Insert slide to the blank presentation
            blankPresentation.Slides.Insert(0, cloneSlide);

            //Get inserted slide from blank presentation
            ISlide templateSlide = blankPresentation.Slides[0];

            //Append templateSlide to the presentation
            presentation.Slides.Append(templateSlide);

            //Save and launch to view the PPTX document.
            presentation.SaveToFile("new-file.pptx", Spire.Presentation.FileFormat.Pptx2010);


Template File:
crashes-app.zip


I notice that the crashes-app.pptx file type is LibreOffice/6.4.7.2$Linux_X86_64 LibreOffice_project/40$Build-2 (I get the ppt file versions according to that page. https://stackoverflow.com/questions/440 ... a-ppt-file)

When i open and save as that crashed pptx file this time that pptx file works fine :attachment=0]crashes-app-fix.zip[/attachment]


crashes-app-fix.pptx file type is 16.0000 (PPT 2016)

Can you check that problem ?
Thank you.

omurertanis
 
Posts: 22
Joined: Tue Mar 30, 2021 7:56 pm

Fri Feb 04, 2022 6:18 am

Hello,

Thanks for your inquiry.
I did notice the exception you mentioned. As for why copy the second slide from crashes-app-fix.pptx without throwing exception, I guess it is related to the compatibility of the document's data structure. This issue has been submitted to our Dev team for investigating and fixing with ticket number SPIREPPT-1844, once this is any update, I will inform you. Apologize for the inconvenience caused.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1195
Joined: Tue Sep 27, 2016 1:06 am

Wed Apr 20, 2022 9:44 am

Hello,

Thanks for your patience.
Glad to inform you that we just released Spire.Presentation Pack Hotfix Version:7.4.5, which fixes the issue of SPIREPPT-1844. Please download the new version from the following links 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

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.Presentation