I’ve lost approximately 3 days about this topic. I read tens of posts by finally I’ve understood…
I’m working on a solution including a file conversion from a document in MS Office 2003 format (doc, xls, ppt) to PDF.
To do this I’ve seen several products base on a windows service which utilize MS Office 2007 or Open Office capabilities to export your documents in PDF format.
I’m not very satisfy to accomplish the requirements with a product, so I started to investigate different examples to create my custom solution.
I started with the following projects hosted on “The Code Project” portal.
While the first example is pretty easy to try (the only trouble is to find the correct version of Open Office to install :-)), the second hides unpredictable scenarios. In fact, after the test of the Office automation using the simple application form in the example, I try to export the code in a windows service process. The code is the same you can find in this MSDN article:
Google searching response, further the “Microsoft does not support Office server side automation (for version till 2007 – see here)” notice, says that other guys experienced in same problem using Windows 2008 services (see this post). So, I tried the same custom service in a virtual machine with Windows Server 2003 and all went well. With an in deep search I’ve found other very usefully posts regarding Windows 2008 Server family lack about a particular folders. In detail:
- for x64 system is necessary to create the following folder:
- for x86 system:
After this little tip, also Windows Server 2008 service resumed to work well providing the Office automation desired.References:
- Generate PDF Using C#
- Convert Word-Documents to PDF on an ASP.NET Server
- Saving Word 2007 Documents to PDF and XPS Formats
- Considerations for server-side Automation of Office
- Word Automation through Windows service (Windows Server 2008) - Problem
- Excel 2007 automation on top of a Windows Server 2008 x64
- Word Interop Not Working In A Scheduled Task