Converting MS Word Documents to PDF in ASP.NET

Posted by glaxaco on Stack Overflow See other posts from Stack Overflow or by glaxaco
Published on 2008-10-01T21:05:21Z Indexed on 2010/05/20 11:50 UTC
Read the original article Hit count: 282

Filed under:
|
|

Similar questions have been asked, but nothing exactly like mine, so here goes.

We have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field merge, the server must convert the document to PDF and stream it down to the browser. Our first inclination was to use the Visual Studio Tools for Office API; however, we ran into this warning from Microsoft:

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

It looks like the field manipulation can be done using the Open XML SDK, but what's the best way to convert Word 2007 documents to PDF without opening Word? The optimal solution would be low-cost, scalable, have a low memory footprint, be easy to deploy, and have a .NET API.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about pdf