简体   繁体   中英

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 that 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM