4

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?

Gustavo Mori
  • 8,319
  • 3
  • 38
  • 52
Equixor
  • 259
  • 4
  • 13
  • Although not in memory, so maybe not useful in this case, there's a great answer in this post for others who come across this post: http://stackoverflow.com/questions/607669/how-do-i-convert-word-files-to-pdf-programmatically – keyboardP Jun 07 '11 at 23:44
  • Yeah unfortunately the doing it in memory requirement is the most important part. I already have a solution that writes to a file. The Word 2007 approach either using the plug in that question refers to, or the built in ExportAsFixedFormat, both output to a file; which doesn't solve the problem. – Equixor Jun 08 '11 at 00:05

1 Answers1

1

ASPOSE can do this for you, see this link for a tutorial on going from a DOC to PDF memory stream.

Zachary
  • 6,522
  • 22
  • 34
  • K thanks. ASPOSE.Words definitely seems like a strong contender. Code is very simple. Looks like I would need the Developer OEM license to be able to deploy to all our sites. A tad pricey since I'd only use that one feature, but not terrible. – Equixor Jun 08 '11 at 00:04