Converting MS Office to PDF/XPS using PDFTron PDFNet on Windows Server 2008 64-bit

Q: We use pdftron.PDF.Convert.ToPDF() as conversion method from MS
Office to PDF/XPS inside a Windows Service as well as a web
application running in Tomcat as a service on Windows Server 2008 64-
bit. We do not have problem when tomcat is launched manually (in user
session). Also the problem does not occur on our 2003, XP, or Vista
machines. When trying to convert a word document, the we are getting
the following errror

Caused by: Exception:
          Message: An error occurred while converting the file.
         Unable to convert file, too many attempts.

A: A potential solution is described in the following article:
Hot Malva tech blog: How to use Office 2007 Automation in Windows 2008 service

After I created the following folder in my VM (I have recently
upgraded my VM to 64 bit win 2008 instead of 32 bit win7 to more
closely match our test and production environments)


Once this folder was created, the application worked properly when
processing word documents in both my VM and Production.

Please note that there are other solutions, but they are more
complicated. The problem seems to be related to permission and session
issues (see

Attached is a utility function that can be used to run a process (such
as console application based on PDFNet) from a local system account
(CreateProcessAsUserFromLocalSystemAccount()). Some of the important
points are:

- Because the function is impersonating the active user, the service
should log on as local system account.
- The impersonated user must be admin.
- The output folder [outDir] was the same as workingfolder passed in
the call to CreateProcessAsUserFromLocalSystemAccount.
- We made sure that the user has permissions to access to all the