title: c# - Convert doc to pdf in memory
body: <p>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.</p>
  
  <p>My current approach is using PDFCreator which creates a file on the harddrive. I then read this file back into memory using <code>byte[] File.ReadAllBytes(filename)</code>. 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.</p>
  
  <p>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.</p>
  
  <p>Free is nice but not strictly required. This needs to be able to deploy as part of an application to multiple sites. </p>
  
  <p>Any suggestions for how best to do this?</p>