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 May 26, 2022 2:27 pm

Im using FreeSpire.Presentation v7.2

Im getting the below error when I edit an existing pptx and add/change something.

Powerpoint found a problem with content in xxxxxxx.pptx. Powerpoint can attempt to repair the presentation.

When I click repair, then the following error

Powerpoint counldnt read some content in xxxxxxxxxx.pptx - Repaired and removed it. Please check your presentation to see if the rest of it looks ok.

All my edits/changes are gone! Here is my code snippet.

Code: Select all
            Presentation uPPT = new Presentation();
            try
            {
                Log.Information($"Opening PPT {pptFName}");
                uPPT.LoadFromFile(pptFile);
                SizeF slideSize = uPPT.SlideSize.Size;
                float halfWidth = (slideSize.Width / 2) - 40;
                float halfHeight = (slideSize.Height / 2) - 40;
                float fullWidth = slideSize.Width - 40;
                float fullHeight = slideSize.Height - 40;

                RectangleF halfRect1 = new RectangleF(20, 20, halfWidth, fullHeight );
                RectangleF halfRect2 = new RectangleF(20 + halfWidth, 20, halfWidth, fullHeight );
                RectangleF fullRect = new RectangleF(20, 20, fullWidth, fullHeight);
                if (HasLMData)
                {
                    IChart chart1 = uPPT.Slides[1].Shapes.AppendChart(ChartType.ColumnClustered, halfRect1);
                    //Populating Datatable
                    var dtEnabledUsers = licenseData.GlobalList.Select(s => new ChEnabledUsers()
                    {
                        EnabledUsers = (int)s.EnabledUsers,
                        Registrations = (int)s.Registrations,
                        ReportDate = s.ReportDate
                    }).JSON2Datatable();

                    chart1 = InitChartData(chart1, dtEnabledUsers);
                    chart1.Series.SeriesLabel = chart1.ChartData[0, 1, 0, dtEnabledUsers.Columns.Count - 1];
                    chart1.Categories.CategoryLabels = chart1.ChartData[1, 0, dtEnabledUsers.Rows.Count, 0];
                   
                    uPPT.SaveToFile(pptFile, fileFormat: Spire.Presentation.FileFormat.Pptx2013);
                    uPPT.Dispose();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Error while populating PPT");
                throw;
            }
            return "Success";


I can see that you have fixed these issues with hotfix on Spire.Presentation version, but looks like the FreeSpire version is still not fixed.

balajibv
 
Posts: 1
Joined: Wed May 25, 2022 2:52 pm

Fri May 27, 2022 10:00 am

Hello,

Thanks for your inquiry.

Sorry, we only update the free version from time to time. It's not updated frequently, so there may be some fixes that weren't included. Sorry again for that and hope you can understand.
Sincerely,
Andy
E-iceblue support team
User avatar

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

Return to Spire.Presentation