Error when executing command line utility from secondary program


I am working with a client school, University of Connecticut Health Center, developing an automated conversion of RTF to PDF documents. We chose veryPDF docPrint Pro to do the job in large part because of its command line abilities.

When executing the conversion from a dos prompt as a normal user the conversion executes correctly. We are attempting to call the process from a .net program running out of IIS. When run from there, the output indicates that "Output: Please install MS Office product in order to convert MS Office documents!!!". Obviously it is installed since it works from the command line, but I'm guessing that the tool is having trouble locating the path of it while being called from IIS.

My question is this, what is the docprint program looking for to see if office is installed? Is it an environment variable? 


Please refer to Example #6 at following web page,

Example 6: Run conversion via "docPrint_Service.exe" application,

Please by following steps to run conversion via "docPrint_Service.exe" application,

1. Please login your server via Remote Desktop under Administrator user account (or other user accounts who own Administrator right),

2. Please run "docPrint_Service.exe" application,

    "C:\Program Files\docPrint Pro v5.0\docPrint_Service.exe"

3. Call RunCmd() method to deliver a command line to "docPrint_Service.exe" application,

PHP example,

    $com = new COM("DocPrintCom.docPrint");
    $com->docPrintCOM_Register("XXXXXXXXXXXXXX"," Inc.");
    $com->RunCmd("-i -o C:\\test\\output.pdf -* XXXXXXXXXXXXXX -d -O 2 -s ShowHTMLStatusBar=1 -l 10000", 0);

VB example,

Private Sub Command1_Click()
    Set docPrint = CreateObject("DocPrintCom.docPrint")
    nRet = docPrint.docPrintCOM_Register("XXXXXXXXXXXXXX", " Company")
    nRet = docPrint.RunCmd("-i -o C:\output.pdf -* XXXXXXXXXXXXXX -d -O 2 -s ShowHTMLStatusBar=1 -l 10000", 0)
    MsgBox "Return value = " & Str(nRet)
End Sub

4. Close Remote Desktop and leave this user logged in.

*Please Notice: After you reboot the server, you need login your server via Remote Desktop with this user account ("docPrint_Service.exe" was installed inside this user account), and close Remote Desktop, leave this user logged in, when you call RunCmd() function, the conversion will be executed from this user account automatically.

You can use above example to call docPrint Pro command line from .NET or ASP code easily.


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

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!