How to call doc2pdf.exe from .NET4.5 windows service which written in C# source code?

Hi,

I'm running Win8.1 and am building a .NET4.5 windows service in C#. When executing doc2pdf from the command line it all works fine. With for example this string:

"C:\Program Files (x86)\docPrint Pro v6.0\doc2pdf.exe" -i "C:\1Temp\635296083729535451.xml.html" -o "C:\1Temp\635296083729535451.xml_stylesheet.tif" -b 1 -c 4 -r 300

But when executing the same code from the windows service I see that the process is started in the TaskManager but it doesn't do anything. It keeps hanging there forever without doing anything at all for hours and hours :).

Would you have any idea what the problem could be? My code looks as follows:

Interaction.Shell(doc2PdfArguments, AppWinStyle.Hide, true, -1);

The variable doc2PdfArguments is the same string as entered before.

Any help is truly appreciated.

Thanks!
Customer
----------------------------------------------
You can use VeryPDFComRunCmd COM to call doc2pdf.exe from a Windows Service,

http://www.verydoc.com/blog/verydoc-release-notes-verydoc-releases-an-exe-com-of-verypdfcomruncmd-exe-today-verypdf-exe-com-does-allow-you-to-call-ms-office-and-any-exe-application-from-asp-php-c-net-etc-program-languag.html

VeryPDFComRunCmd is an EXE COM Component which can be used to launch any EXE or Office application from ASP, PHP, C#, .NET etc. program languages. VeryPDFComRunCmd COM is a freeware. (More Information)

VeryPDFComRunCmd.zip (825 KB).

http://www.verypdf.com/dl2.php/VeryPDFComRunCmd.zip

You can use following ASP code to call any EXE or MS Office without any permission problem,

<%

set VeryPDFCom = Server.CreateObject("VeryPDFCom.RunCmd")
dim nRetVal, bRet
bRet = VeryPDFCom.RunCmd("C:\windows\notepad.exe", 5, 0)
strRet = VeryPDFCom.RunCmd2("cmd /c dir C:\", 5)
Response.Write strRet & vbCrlf

%>

VeryPDFComRunCmd COM is a Windows COM Component, it can be used to call any EXE application from Windows Service, ASP Code, Local System user account etc.

The second solution is Run conversion via "docPrint_Service.exe" application, please look at following web page for more information,

http://www.verypdf.com/wordpress/201109/doc2any-sdk-dll-does-work-on-localhost-but-not-work-on-internet-2333.html

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in docPrint Pro and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!