SharpDocx
SharpDocx copied to clipboard
Split File & Stream usage
Keep DocumentBase but put on top DocumentFileBase and DocumentStreamBase. Adapt tests to generate also "Stream Version"
Feel free to comment if I made any mistake :) I will fix
Thank you! I'll have to test it a little bit and I'll let you know if I find anything.
Is it possible to merge this PR ? I'm very interested by the Stream support.
Using it for few weeks and seems to work :D
@egonl how long will it take until this will be released as a package? Me and my Team really want this feature and would like to avoid forking the Repo.
I'm a bit reluctant, because accepting a random stream containing code that will be executed is a huge security risk. What is your exact use case for which you need streams?
@egonl our current Use case is that we want to be able to 1st: Cache the Templates in memory, to not do the IO work over and over again and then be able to use the same template multiple times in paralel, as they are used based on Messaging coming in inside a WebApi Application. So the current idea is, with this kind of API, we could Read all our Templates once, and then have pools for them, that the service instances can then grab and release, when needed.
If we want to do this currently, we'd have to Copy the Files and then pass the path to the new file into the DocumentFactory, this would likely lead to memory leaks, with randomly generated names atm tho, the way the caching is designed.
We would also be just as happy with having some sort of ByteArray as Input aswell, or being able to compile the Files seperately and being able to pass in the Compiled Document Template. We just want to not be coupled to the file system directly. Thank you for your Quick response :)
Any news, thoughts or insights on this Topic?
@btoepferDm Added support for view streams in #69. Could you give that a try?
@btoepferDm Added support for view streams in #69. Could you give that a try?
Thank you very much, i will give it a try, hopefully today, latest tomorrow. Will get back to you with feedback, as soon as i have :)
Implemented in #69, closing PR.