I have been using the following script for some time now in a batch file to print PDF files to a printer:
c:\path\to\PDFtoPrinter.exe c:\path\to\file.pdf "\\ip\printer"
I had hoped to simply add this to a PHP script using exec() and all would work, but no.
exec('c:\\path\\to\\PDFtoPrinter.exe c:\\path\\to\\file.pdf "\\\ip\\printer"');
My other idea was to write the commands to a bat file and execute that file from my PHP script, but also no success.
Any suggestions?
exec("\\path\\to\\PDFtoPrinter.exe \\path\\to\\file.pdf '\\ip\printer'");
The following works for me:
exec("c:\\path\\to\\PDFtoPrinter.exe c:\\path\\to\\pdf.file \"printer-name\"");