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.
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,
and this one,
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,
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,
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.