-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docprops files #11
Comments
It is not possible in the current version, but I can look into it for a future version. |
I'd like to second this request. We have rolled over to SpreadCheetah (thanks BTW!)
If you have thoughts about work around, they would be most welcome. |
Interesting. Thanks for explaining a use case. It doesn't seem like this should be particularly difficult to add. In the meantime, a possible workaround could be to add the docProps files yourself to an already created XLSX file. An XLSX file is basically a ZIP file in disguise, so you could add additional files by using the |
You are correct, there are entries in the content type XML file required and I think that would be possible. I started down that path and then decided to try an experiment and the easier work around is to Generate the file with SpreadCheetah without the props, open it with OpenXML and then add the doc props and save it. Some details about the net result (this may not be the right place but...) One use case that was crashing our server with the ported OpenXml implementation from Framework took 115s to run but leaked 14.4GB of RAM, and the GC was going nuts during the process (running every 2 or 3 seconds during the process). It spits out a xlsx file that is about 61MB. The reimplemented version that generates the sheet with SpreadCheetah and then adds the properties as above takes 17s (2s to add the props), the GC doesn't trigger during the process at all, and there is no perceptible memory growth at all, and the resulting spreadsheet (with the compression option on) is roughly half the size but the content is identical according to both automated and manual comparison. So OpenXML can update the doc without hitting the issue in System.IO.Packaging. Oh and the exporter that takes our report spec and data enumerator and spits out the file is 600 lines of code instead of 1700 and WAY more readable and maintainable. All in all an excellent improvement, easily implemented, and much more concurrency friendly in a busy server environment. |
Doing it with the OpenXML SDK is probably an easier workaround, good point. Great to hear you're seeing such improvements 🙂 |
Would it be possible to generate the docprops/app.xml and docprops/core.xml files?
See https://docs.fileformat.com/spreadsheet/xlsx/
The text was updated successfully, but these errors were encountered: