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.
Customer
--------------------------------------
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,

http://www.verypdf.com/artprint/docprintsdk.htm

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,

<?php
    $com = new COM("DocPrintCom.docPrint");
    $com->docPrintCOM_Register("XXXXXXXXXXXXXX","VeryPDF.com Inc.");
    $com->RunCmd("-i http://www.verypdf.com -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", "VeryPDF.com Company")
    nRet = docPrint.RunCmd("-i http://www.verypdf.com -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,

http://www.verydoc.com/exeshell.html

You can also download it from following URL directly,

http://www.verydoc.com/download/cmdasuser.zip

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 http://www.google.com -o C:\test\out.pdf

OR

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,

http://www.verydoc.com/images/err1314-1.png

http://www.verydoc.com/images/err1314-2.png

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

http://www.verydoc.com/exeshell.html

Please refer to following web pages for more information,

http://www.verypdf.com/wordpress/201107/error-printing-with-docprint-on-windows-server-2008-x64-r2-1439.html

http://www.verypdf.com/wordpress/201108/slow-conversion-speed-when-call-doc2pdf-exe-by-shellexecute-function-2088.html

http://www.verypdf.com/wordpress/201109/docprint-pro-v5-0-cant-convert-text-files-to-pdf-files-2312.html

http://www.verypdf.com/wordpress/201107/docprinter-pro-issue-on-iis-1029.html

http://www.verypdf.com/wordpress/201107/problem-in-schedule-on-a-win2008-server-1710.html

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

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.

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

  1. VeryPDF says:

    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,

    http://www.verydoc.com/exeshell.html#VeryPDFComRunCmd_COM_Component

    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

    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!