PDF Printer can’t print PDF file to network printer from Windows Service

Hello,

When using VeryPDF printpdf, it works fine from the windows command line.  However when we shell out to the operating system from within an application, and redirect the io to a file, we see that printpdf cannot find the printer that we are passing to it.  This seems to have begun happening when we moved to a new server.  Please note, if we shell out of the same application and run the –listprinter option and redirect the io to a file we can see that it is listing out the printer we are passing to it.

Please advise,

Thanks,

=========================================

Are you trying to call pdfprint.exe from Windows Service application or non-interactive user account (Local System Account or System account or others)? If yes, please notice an important matter, Service account and system accounts haven't privilege to access to network at default, please refer to following information,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In default, Windows does not enable the SYSTEM user account to access to network resources. The easiest method to bypass this is to run your app under a real account (interactive user account) that has network access rights.

If you're utilizing the Win2000 scheduler to start your app, it is possible to alter the account easily, right click your "task", select "Properties" menu item, and change the Run As: account.

If you are being launched by a custom service, change the account the service runs under. In Services, right click the service, select "Properties" menu item, switch to Logon tab, select "This account" and enter the account information.

If you can't do that, you are be able to grant the SYSTEM account privileges to things, see this article,

http://support.microsoft.com/default.aspx?scid=kb;EN-US;132679

and this one,

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q124/1/84.asp&NoWebContent=1

but these are old and you may no longer be able to do this.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We have another solution to you, you can use VeryPDF CmdAsUser.exe application to run pdfprint.exe from an interactive user account, CmdAsUser.exe can be downloaded from following web page,

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

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

after you download and unzip cmdasuser.zip to a folder, you can run following command line to print your PDF file to network printer,

CmdAsUser.exe Administrator . /p password /c "C:\pdfprint.exe" -printer "\\192.168.1.10\VeryPDFPrinter" C:\verypdftest.pdf

If you encounter Error #1314 problem with above command line, please refer to the solution of Error #1314 at following web page,

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

after everything is fine in CMD window, you can call above command line from your Service or ASP or PHP or C# source code, then you can print the PDF file to network printer properly.

VeryPDF

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
PDF Printer can’t print PDF file to network printer from Windows Service, 10.0 out of 10 based on 1 rating

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!