How to run doc2pdf.exe which included in docPrint Pro from Web Service?

Hello We are planning to use your component for unattended documents processing on ~50 workstations. The (doc2pdf) application will be invoked by a windows service. The process will be unattended, as such we would like to know about potential pitfalls e.g. run time errors. We know you have server license, but that won't work for us - the processing will be distributed (geographically).

Thank you.
You need run doc2any.exe from an interactive user account instead of default system user account, please refer to the example #6 and example #7 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.

Example 7: Run conversion inside an interactive user account from service or web applications,

Please by following solution to run document conversion inside an interactive user account,

1. Please add "Everyone" user account to "C:\Program Files\docPrint Pro v5.0" folder and sub-folders, give "Full Control" permission to "Everyone" user account,

2. Download CmdAsUser.exe from following page,

You can also download it from following URL directly,

3. Run following command line to test CmdAsUser.exe application,

C:\test\CmdAsUser.exe Administrator . /p password /c "C:\Program Files\docPrint Pro v5.0\doc2pdf.exe" -i -o C:\test\out.pdf


C:\test\CmdAsUser.exe Administrator . /p password /c "C:\Program Files\docPrint Pro v5.0\doc2pdf.exe" -i C:\test\test.doc -o C:\test\test.pdf

If you can run above command line in Command Line Window correctly, please call above command line from PHP by shell_exec() function or other web applications, then you will get it work properly.

Please notice:

1. You need modify "Administrator" and "password" parameters to correct user name and password in above command line, CmdAsUser.exe will launch doc2pdf.exe from this special user account with administrator privilege.

2. You may encounter Error 1314 in some Windows systems when you switch between user accounts, this is caused by permission setting, please by following steps to solve this 1314 Error,

ERROR 1314:

1314 A required privilege is not held by the client. ERROR_PRIVILEGE_NOT_HELD
To resolve this issue:
1. Click Start, click Run, type "secpol.msc", and then press ENTER.
2. Double-click "Local Policies".
3. Double-click "User Rights Assignment".
4. Double-click "Replace a process level token".
5. Click "Add", and then double-click the "Everyone" group
6. Click "OK".
7. You may have to logout or even reboot to have this change take effect.
Please refer to following two screenshots to understand above steps,

Please look at following page for the details about ERROR 1314,

Please refer to following web pages for more information,

If you still can't get it work, please feel free to let us know, we will assist you asap.


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

One Reply to “How to run doc2pdf.exe which included in docPrint Pro from Web Service?”

  1. Here is another solution to run doc2pdf.exe from an interactive user account, when you try to call doc2pdf.exe from a Windows Service or a Web Service, you can use “VeryPDFComRunCmd COM Component” to call doc2pdf.exe and set it run inside an interactive user account,

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

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!