Open-XML-SDK
Open-XML-SDK copied to clipboard
OpenXmlPackage.SaveAs() corrupts file names
Describe the bug
OpenXmlPackage.SaveAs() corrupts names of the internal package files.
To Reproduce Steps to reproduce the behavior:
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

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
@adamshakhabov, which version of OpenXML SDK are you using? If not the latest version, could you try it with the latest version.
I use the latest 2.17.1.
@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.
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.
Any updates?
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.