Repair file message appears on opening the generated PPTX (C# .NET)

We are getting an error " PowerPoint found a problem with content in Output1.pptx. PowerPoint can attempt to repair the presentation " when we try to open a PPTX file which was created using Aspose.Slides for .Net version 19.7.0.0

Presentation pres = new Presentation(Server.MapPath("/") + “Test_Template.pptx”);

pres.Save(Server.MapPath("/") + “FileLocation\Test.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);.

@Swedha,

I have observed the issue shared by you and request you to please first try using Aspose.Slides for .NET 20.2 on your end. In case there is still an issue then please share the source presentation, generated presentation and snapshot of issue on your end.

Yes the same issue is happening with 20.2 version as well. We have purchased the licensed version of Aspose. Now it breaks for higher versions. This is very urgent.

This is code
Presentation pres = new Presentation(Server.MapPath("/") + “Test_Template.pptx”);

pres.Save(Server.MapPath("/") + “FileLocation\Test.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);.

MemoryStream ms = new MemoryStream();

        ms.Position = 0;

        byte[] newcontent = new byte[fis.Length];
        fis.Read(newcontent, 0, newcontent.Length);
        ms.Write(newcontent, 0, newcontent.Length);
        fis.Close();
        ms.Flush();
  Response.Clear();
                Response.ClearContent();
                Response.ClearHeaders();
                Response.ContentType = contentType;
                Response.AddHeader("Content-Disposition", String.Format("Attachment; filename={0}", fileName));

                MemoryStream ms = new MemoryStream(newContent);
                ms.WriteTo(Response.OutputStream);
               

                Response.Flush();
                Response.Buffer = true;
                HttpContext.Current.ApplicationInstance.CompleteRequest();

image.png (63.8 KB)

@Swedha,

I have observed the image shared along with sample code. As mentioned earlier, I need source presentation and generated output presentation with issue on your end that I may test and verify on my end.

It works now when we change the Response to output stream. Thanks

@Swedha,

It’s good to know things are working on your end. Please feel free to share if you encounter any issue.