I am working on task to print pdf using shell_exec()
on WAMP and my code is
echo '"C:\\Program Files\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe"
/t c:\\bill.pdf'.'<br>';
shell_exec('"C:\\Program Files\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe"
/t c:\\bill.pdf');
echo output "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t c:\bill.pdf
When I paste this command in cmd, the command gets executed,but when I paste same command in shell_exec()
,command doesn't gets execute.
I have tested shell_exec('lpr')
and it outputs
Sends a print job to a network printer Usage: lpr -S server -P printer [-C class] [-J job] [-o option] [-x] [-d] filename Options: -S server Name or ipaddress of the host providing lpd service -P printer Name of the print queue -C class Job classification for use on the burst page -J job Job name to print on the burst page -o option Indicates type of the file (by default assumes a text file) Use "-o l" for binary (e.g. postscript) files -x Compatibility with SunOS 4.1.x and prior -d Send data file first
which means shell_exec()
is working but print command is not working.
How can I execute print command using shell_exec()
?