c# - Convert doc to pdf in memory
We're using a 3rd party XML messaging service that requires an embedded PDF file when sending a file. We currently have word files we'd like to send using this messaging service, which requires us to convert them to PDF files.
My current approach is using PDFCreator which creates a file on the harddrive. I then read this file back into memory using byte[] File.ReadAllBytes(filename)
. I can then embed tha开发者_开发百科t into the XML message. While this approach works, I'd like to skip the writing out to a file step and keep the process solely in memory. Why pay for disk IO and having to then go back to remove this file if it's not required etc.
PDFCreator doesn't seem to have this option, Word 2007 ExportAsFixedFormat also goes to a file, I'm unsure if Aspose can perform the conversion strictly in memory.
Free is nice but not strictly required. This needs to be able to deploy as part of an application to multiple sites.
Any suggestions for how best to do this?
ASPOSE can do this for you, see this link for a tutorial on going from a DOC to PDF memory stream.
精彩评论