document converter was not able to convert the file

May 12, 2009 at 1:17 PM

Hey guys, really nice solution. i get some error while converting from doc2PDF and noticed through EventViewer after navigating to SharePoint Site URL http://<serverName>:<portNumber>/<documentLibrary/_layouts/DocTrans.aspx?FileName=<documentName>

first Error Log: The document converter was not able to convert the file.

Category: Timer Job

Second Error Log: Even with normal attribs, still couldn't delete file C:\Program Files\Microsoft Office Servers\12.0\Bin\HtmlTrLauncher\input.doc: System.IO.IOException: The process cannot access the file 'C:\Program Files\Microsoft Office Servers\12.0\Bin\HtmlTrLauncher\input.doc' because it is being used by another process.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

at System.IO.File.Delete(String path)

at Microsoft.Office.HtmlTrans.HtmlTrLauncher.EnsureCleanOutputDir()

Category: Launcher Service

Thanks in advance


May 12, 2009 at 5:13 PM

I've always loved that error!  The machine must know what that 'other process' is but it never says does it?

In this case the file is failing to convert for a reason having nothing to do with the error you see. Notice that the error is being thown at System.IO.File.Delete(String path) when sharepoint trys to delete the temporary input file. This indicates to me that the process of converting the file is never being completed.  If you look at task manager when this occurs you will probably see an instance of word is still running. 


First thing to do is just launch word on the server, open a document, and try to save it to PDF.  You have to patch word 2007 to get the save-to-pdf feature.  

Second thing to do is just run the command line application from the command line, just to make sure that the actual executable is able to launch word and save the file as PDF.  

Third is make sure HVU_ComputerName has right to interact with the desktop.  Don't make the common mistake of putting HVU_ComputerName in the admin group - its not secure and it won't help. You have to edit the machine policy to grant this right.

If you read through this site you will see where people have had issues and resolved them.  9 out of 10 its the HVU_ComputerName issue.

Best Regards,




May 12, 2009 at 5:14 PM

Also, copying here this helpful post:


see the following link. How to configure Office applications to run under the interactive user account

This worked for me. Had to change the security of the HtmlTrLauncher directory to allow the interactive user read/write perms (which I think will be changed back the next time the launcher service starts again)

Also, I added some extra releasing of COM objects to prevent WINWORD processes hanging around.


May 14, 2009 at 3:09 PM
Edited May 14, 2009 at 3:10 PM

Hey ben, thanks for replying me...

bad to say - it was a broken link, ain't no-problem. but, i have to sort out this issue by read through your site and

the second step you mentioned is not working for me?

"application from the command line" - i donot know why its not throwing any exceptions onto Event Viewer or even in Command line...

Any how it was a really nice solution to work with...

Thanks in advance



May 14, 2009 at 9:45 PM

to run the command line you can try doc2pdf  -in c:\test.docx -out c:\test2.pdf -log c:\log.txt and add the test.doc to the C:\

I did all the steps mentioned but, I'm now having 4 error entry's at the event viewer every time I run the document converter from MOSS.

1 - Object reference not set to an instance of an object.

2 - The document converter was not able to convert the file.

3 - Object reference not set to an instance of an object.

4 - Object reference not set to an instance of an object.

Anyone have an Idea on how to fix this?


May 14, 2009 at 11:39 PM


Are you able to convert a file if you run this command directly from the command line?

If so then your close to having it working.

Here are some things to do;

1) Activate the "Publishing Infrastructure Feature" on the site collection

2) Turn on Document Converters in the SharePoint Admin Section

3) Alter Machine Policy to allow HVU_ComputerName account to login and interact with the desktop (adding HVU_ComputerName to the Admin group will not automatically grant this right.  Its in the machine policy)

4) Change the security of the HtmlTrLauncher directory to allow the interactive user read/write perms

5) Verify the executable exists in both these locations;

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\Doc2PDF\Doc2PDF.exe

C:\Program Files\Microsoft Office Servers\12.0\TransformApps\Doc2PDF.exe

6) Make the freature called 'Doc2PDF' has been activated on the site collection


Sorry its so tricky.  Feature deployment in sharepoint kind of misses some aspects of deploying a document converter, for example placing the executable in C:\Program Files\Microsoft Office Servers\12.0\TransformApps\.  There are lots of manual steps


May 15, 2009 at 3:54 AM
Edited May 15, 2009 at 5:04 AM

Thanks for the reply :)

I have it working from the command line.

The publishing Infrastructure feature is active

Document Converters are running and running as "Local Service"

HVU_ComputerName has the following policies (Allow Logon as service, Allow Logon locally)

HVU_ComputerName and the Interactive User has full control on HtmlTrLauncher directory

Doc2PDF.exe exist on both folders

I don’t find the feature 'Doc2PDF' neither on the central admin nor the site but the solution is installed and there is a "Word to PDF Converter" feature active and I’m getting the dropdown with the convert to pdf.

I have verified everything and tried on a Win2008 and a Win2003 configurations. 

I'm still getting 3 Object reference not set to an instance of an object and 1 The document converter was not able to convert the file.

I just tryed to debug the VS solution and its having an exeption because gLogPath is null on the main function.  I hardcoded a logpath and now I see this on the log:

5/14/2009 11:42:17 PM Started
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
5/14/2009 11:43:29 PM Started
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
5/14/2009 11:44:02 PM Started
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

Any Idea on what else I can try?

Thanks in advance

Jose V

May 15, 2009 at 6:04 PM


Did you run the following commands (Below)?  Also you can use STSADM to enumerate the features available.  I think you should see a feature called "Doc2PDF".  Beyond that Im not sure what problem this could be, but if you can convert a file from the command line that means the converter itself works, and from there the problem is a sharepoint problem.


%STSADM_PATH% -o addsolution -filename %WSP_LOCATION% 


%STSADM_PATH% -o deploysolution -name %WSP_FILENAME% -immediate


%STSADM_PATH% -o installfeature -name %FEATURE_NAME% -force


%STSADM_PATH% -o activatefeature -name %FEATURE_NAME% -url %SERVER_URL% -force