We bought your command-line PDF print software for use in one of our applications. However we are unable to get it to work properly, which is now getting critical:
When called from a PHP script, we can list a complete list with printers using -listprinter but when trying to print to any of these, it returns the error,
'Can't locate the "XXX" printer in this computer, please double check the printer name and to try again.'
When using it via a logged-in user (which has a desktop open) and we run the exact same script, the application DOES print. However as we run this on a dedicated server, we cannot have a user session open continuously.
Below is the result of a print when we run the -listprinter first and after that the print with -debug property.
Microsoft XPS Document Writer
Reading Command Line options...
Copyright (C) VeryPDF.com
"C:\inetpub\wwwroot\LBIPUAT\application/libraries\pdfprint_cmd\pdfprint.exe" "-$" "XXXXXXXXXXXXXXXXXXXX" "-debug" "-printer" "ES-ESMDH-24142-T001" "-pdforient" "2" "-scalex" "100" "-scaley" "100" "C:\inetpub\wwwroot\LBIPUAT\application\modules\QA_Weight\download\LB-cf47a67a6899c940d7fdbf89371e7d99.pdf"
Version Build Date: Aug 7 2016
Try to load 'WINSPOOL.DRV' file...
Load 'WINSPOOL.DRV' file OK.
SetDefaultPrinter to 'ES-ESMDH-24142-T001' printer, return code = 0.
Can't locate the "ES-ESMDH-24142-T001" printer in this computer, please double check the printer name and to try again.
Thanks for your message, we known this problem, this problem is caused by Local System user account, because your local system user account hasn't permissions to access to these printers.
You can run pdfprint.exe inside an interactive user account to solve this problem, you can use CmdAsUser.exe to run pdfprint.exe inside an interactive user account, please look at following web page for more information,
You can also use "VeryPDFComRunCmd COM Component" to run pdfprint.exe inside an interactive user account, please look at following web pages to study how to use "VeryPDFComRunCmd COM Component",
After you run pdfprint.exe inside an interactive user account, pdfprint.exe will able to see these printers and able to print the PDF file to these printers properly.