Repair message after loading and saving PPTX using Aspose.Slides for Java

Hi,

When I load and save the attached file and open the saved file in MS PowerPoint, a repair message occurs.

String presentationPath = "test.pptx";

Presentation presentation = new Presentation(presentationPath);

presentation.save("test-aspose.pptx", SaveFormat.Pptx);

http://www117.zippyshare.com/v/XIy0NnVh/file.html
1556.png (82.8 KB)

Can you check this?

Thanks,
Zeljko

@Zeljko,

I have worked with presentation file shared by you using Aspose.Slides for Java 18.1 and unable to observe any issue. I have also shared my generated result with you for your kind reference. Can you please share environment details along with jdk and Aspose.Slides version you are using on your end so that we may further investigate to help you out. File can be downloaded from below link.

@Adnan.Ahmad

Thanks, Adnan. I can confirm there is no issue with the Aspose.Slides 18.1.

Regards,
Zeljko

@Zeljko,

We are glad to know that things are started working on your end.

I’m having the same problem using C# Visual Studio 2017 creating a plain ASPX site using Aspose.Slides 18.2, exporting to Powerpoint 2016 and the following code:

protected void Page_Load(object sender, EventArgs e)
{
Presentation pres = new Presentation();
pres.SlideSize.SetSize(SlideSizeType.OnScreen16x9, SlideSizeScaleType.DoNotScale);
HttpContext.Current.Session[“curPresentation”] = pres;
float currentHeight = pres.SlideSize.Size.Height;
float currentWidth = pres.SlideSize.Size.Width - 80;
IMasterLayoutSlideCollection layoutSlides = pres.Masters[0].LayoutSlides;
ILayoutSlide layoutSlide = layoutSlides.GetByType(SlideLayoutType.TitleOnly);
ISlide slide = pres.Slides.AddEmptySlide(layoutSlide);
MemoryStream ms = new MemoryStream();
Response.AddHeader(“Content-Disposition”, “attachment;filename=Presentation.pptx”);
Response.ContentType = “application/pptx”;
//create a memory stream
pres.Save(ms, Aspose.Slides.Export.SaveFormat.Pptx);
ms.Position = 0;
Response.BinaryWrite(ms.GetBuffer());
Response.End();
}

I get a repair message when I open it and another repair message when I enable editing (the second says that it couldn’t read some content and so removed it). The slides appear to be correct, but the repair messages are disconcerting. This is using the demo version, but I have the same problem with my licensed version.

@jbaronp3,

I have employed your code with little modification in a console application (but this does not affect overall presentation) and generated the presentation. I have opened the saved presentation in PowerPoint 2010 and have not observed any issue. Can you please try opening the attached presentation on your end and share if there is still an issue. Please share the PowerPoint version used on your end as well with which you have reproduced the issue.

SavedPres.zip (19.6 KB)

I’m using Powerpoint 2016, but I can’t get the zip file you linked to. I get this message:

“Sorry, this file is private. Only visible to topic owner and staff members.”

Here’s the file I created here: Presentation.zip (18.9 KB)

@jbaronp3,

I have observed your presentation and it does give Repair message. However based on view of output of presentation, it seems that it has been generated using older version (as older version has slide view issue that has been fixed in Aspose.Slides for .NET 18.2). I created a presentation file using Aspose.Slides for .NET 18.2 on my end and you may download it from this link:
https://drive.google.com/file/d/1p43wLagkgukZvlmu5K2mt7LYjcJt-vv-/view?usp=sharing

Please make sure about product version being used and any issue in opening of presentation of your end. If there is still an issue then please share the Sample project solution that you have used on your end.

I’ve updated and I’m still having the problem. I’ve put a sample project here, https://drive.google.com/open?id=12L6btpqQawPrXvjRuiSCCSbdFKbwcDO7 that demonstrates it with the output using Aspose 18.2.

@jbaronp3,

Can you please try opening the attached presentation on your end and share, if you still get the Repair message. I have generated this using your code on my end. If you get the repair message then please share the complete PowerPoint 2016 version description so that we may investigate it further on our end.

SavedPres.zip (19.5 KB)

Unfortunately I can’t read files posted to this thread, i get “Sorry, this file is private. Only visible to topic owner and staff members.” when I try to click on the link. I was able to access the Google Drive link you posted earlier.

According to my PowerPoint 2016 About Box, I’m using
Microsoft PowerPoint 2016 MSO (16.0.4639.1000) 32 Bit.

@jbaronp3,

We are sorry for your inconvenience. Can you please get the presentation file from this link
https://drive.google.com/open?id=16oltJIw4dnqhqthsszzlMHexvb1t7CxJ
and share if you get repair message error for this as well.

I didn’t get any repair messages when opening or enabling editing with that file. Any ideas?

@jbaronp3,

I have used the same application that you have used for generation of presentation on my end using Aspose.Slides for .NET 18.2. One thing that I have observed is that when you generate your presentation using simple console application, it has different file size as compare to one that is generated using Response stream. I used following sample code on my end and generated presentation has no issue.

public static void TestMemStream()
{
    Presentation pres = new Presentation();
    pres.SlideSize.SetSize(SlideSizeType.OnScreen16x9, SlideSizeScaleType.DoNotScale);
    //HttpContext.Current.Session["curPresentation"] = pres;
    float currentHeight = pres.SlideSize.Size.Height;
    float currentWidth = pres.SlideSize.Size.Width - 80;
    IMasterLayoutSlideCollection layoutSlides = pres.Masters[0].LayoutSlides;
    ILayoutSlide layoutSlide = layoutSlides.GetByType(SlideLayoutType.TitleOnly);
    ISlide slide = pres.Slides.AddEmptySlide(layoutSlide);
    MemoryStream ms = new MemoryStream();
    //Response.AddHeader("Content-Disposition", "attachment;filename=Presentation.pptx");
    //Response.ContentType = "application/pptx";
    //create a memory stream
    pres.Save(ms, Aspose.Slides.Export.SaveFormat.Pptx);


    ms.Position = 0;

    SaveMemoryStream(ms, "C:\\Aspose Data\\Memstream.pptx");
}

public static void SaveMemoryStream(MemoryStream ms, string FileName)
{
    FileStream outStream = File.OpenWrite(FileName);
    ms.WriteTo(outStream);
    outStream.Flush();
    outStream.Close();
}

Memstream.zip (19.6 KB)
Presentation.zip (22.1 KB)

I changed the method I was using to output the MemoryStream to use .WriteTo() instead of .BinaryWrite(), and now it’s working. I don’t get the repair messages anymore. It looks like I can take it from here. Thank you very much for your help!

@jbaronp3,

It’s good to know things have finally worked on your end. Please share, if I may help you further in this regard.