Post edited 9:42 pm – May 3, 2018 by VeryPDF
Please by following steps to try again,
1. please make sure pdfprint.exe can be run from CMD window by manual first,
pdfprint.exe C:verypdftest.pdf
if you can run pdfprint.exe from CMD window to print your PDF file properly, it is indicate everything is fine in the current user account, we assume the current user account is "Administrator",
2. Please download CmdAsUser.exe from following web page,
http://www.verydoc.com/exeshell.html
http://www.verydoc.com/download/cmdasuser.zip
Unzip it to a folder, e.g., to C:verypdf folder, and run following command line to test it again,
CmdAsUser.exe Administrator . /p password /c "C:verypdfpdfprint.exe" -printer "192.168.1.10VeryPDFPrinter" C:verypdftest.pdf
In most systems, you may encounter #1314 error, it is indicate you haven't enough permission to switch the user account, please look at the following web page to solve the #1314 permission problem,
http://www.verydoc.com/exeshell.html
after you solved #1314 permission problem, you should no problem to launch pdfprint.exe via CmdAsUser.exe application, let's continue to the next step,
3.You can call CmdAsUser.exe from your C# code to instead of pdfprint.exe application, for example,
printExe = "C:verypdfcmdasuser.exe";
args = "Administrator . /p password /c "C:verypdfpdfprint.exe" -printer "192.168.1.10VeryPDFPrinter" C:verypdftest.pdf";
var psi = new ProcessStartInfo(printExe, args)
{
ErrorDialog = false,
WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true,
Domain = ConfigurationManager.AppSettings["DomainName"],
UserName = ConfigurationManager.AppSettings["UserName"],
Password = secPass,
};
var pdfPrint = Process.Start(psi);
if (pdfPrint == null)
{
throw new ArgumentException("Failed to start Process.");
}
4. In general, you should no problem to print the PDF file from your C# source code now.
If you still can't get it work, please feel free contact us via email support@verypdf.com, we will try to login your system to research this problem for you asap.
VeryPDF