Open-XML-SDK icon indicating copy to clipboard operation
Open-XML-SDK copied to clipboard

OpenXmlPackage.SaveAs() corrupts file names

Open ashahabov opened this issue 3 years ago • 4 comments

Describe the bug OpenXmlPackage.SaveAs() corrupts names of the internal package files.

To Reproduce Steps to reproduce the behavior:

base.pptx

using var pres = PresentationDocument.Open("base.pptx", true);
var savedAs = pres.SaveAs("modified.pptx");
savedAs.Close();

Observed behavior The following renaming happened:

/ppt/slides/slide1.xml -> /ppt/slides/slide12.xml /ppt/slides/slide2.xml -> /ppt/slides/slide21.xml

image

Expected behavior The original names of /ppt/slides/slide1.xml and slide2.xml should not be changed.

Desktop:

  • OS: Windows 10
  • .NET Target: .NET 6
  • DocumentFormat.OpenXml Version: 2.17.1

ashahabov avatar Aug 28 '22 09:08 ashahabov

@adamshakhabov, which version of OpenXML SDK are you using? If not the latest version, could you try it with the latest version.

hunyu avatar Aug 29 '22 17:08 hunyu

I use the latest 2.17.1.

ashahabov avatar Aug 29 '22 18:08 ashahabov

@adamshakhabov Thank you very much for the information. I am able to repro the issue your described using 2.17.1. I will take the issue back to our engineering team, and we will let you know the resolution.

hunyu avatar Aug 29 '22 19:08 hunyu

I'm original reporter about this issue. When open the output file(e.g. modified.pptx) in PowerPoint and just save it. Then, issue is gone away. Slide filenames are slide1.xml, slide2.xml.. This is interesting thing.

shanaki avatar Sep 02 '22 00:09 shanaki

Any updates?

ashahabov avatar Oct 12 '22 13:10 ashahabov

Hi Adamshakhabov

We traced the issue back, where appending extra sequence number was introduced with Openxml SDK 2.9, and the issue does not repro with 2.8.1 and prior. It impacted not only PowerPoint, but other Office apps as well. No ETA, yet.

hunyu avatar Oct 14 '22 19:10 hunyu