470,862 Members | 1,805 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,862 developers. It's quick & easy.

What is the difference between raw cmd execute on server, and executing by Apache/PHP

Win2k3, PHP 5, Apache 2, Acrobat 7

when I go to my server, pull out cmd.exe and type as follows:

"c:\Program Files\Adobe\Acrobat 7.0\\Reader\AcroRd32.exe" /t
"c:\Program Files\Adobe\Acrobat 7.0\Reader\test.pdf" "labelprinter"
the document test.pdf will be printed on labelprinter. Now,
labelprinter is set for non-default draw "Casette nr 2" and the line
above print it out the way it supposed to be - to the "Casette 2"

when I do something like this by PHP:

$link = "\"c:\\Program Files\\Adobe\\Acrobat
7.0\\Reader\\AcroRd32.exe\" /t \"c:\\Program Files\\Adobe\\Acrobat
7.0\\Reader\\test.pdf\" \"labelprinter\"";

and try to execute it either with exec, shell_exec or $WshShell->Run
from WScript.Shell object, it printing test.pdf but it does not use
non-default already set "Casette 2". The page is still printed on
"Casette 1".

Where is the problem? I would say with printer or Adobe, but when I go
by cmd.exe on the server, it is printed out properly "Casette 2", but
when I try to execute by PHP using the same batch script line, it
stills go to the wrong Casette 1.
Did for anyone this issue sound familiar?

Any help will be greatfull :)

Mar 17 '06 #1
2 2401
try to generate by php a .bat file, execute it, and then delete the .bat
file
<jo*****@tlen.pl> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Win2k3, PHP 5, Apache 2, Acrobat 7

when I go to my server, pull out cmd.exe and type as follows:

"c:\Program Files\Adobe\Acrobat 7.0\\Reader\AcroRd32.exe" /t
"c:\Program Files\Adobe\Acrobat 7.0\Reader\test.pdf" "labelprinter"
the document test.pdf will be printed on labelprinter. Now,
labelprinter is set for non-default draw "Casette nr 2" and the line
above print it out the way it supposed to be - to the "Casette 2"

when I do something like this by PHP:

$link = "\"c:\\Program Files\\Adobe\\Acrobat
7.0\\Reader\\AcroRd32.exe\" /t \"c:\\Program Files\\Adobe\\Acrobat
7.0\\Reader\\test.pdf\" \"labelprinter\"";

and try to execute it either with exec, shell_exec or $WshShell->Run
from WScript.Shell object, it printing test.pdf but it does not use
non-default already set "Casette 2". The page is still printed on
"Casette 1".

Where is the problem? I would say with printer or Adobe, but when I go
by cmd.exe on the server, it is printed out properly "Casette 2", but
when I try to execute by PHP using the same batch script line, it
stills go to the wrong Casette 1.
Did for anyone this issue sound familiar?

Any help will be greatfull :)

Mar 17 '06 #2
I forgot to say, that this was also my solution, but it acts the same
as from PHP which is wrong :(

Mar 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sean | last post: by
3 posts views Thread by Bob Garbados | last post: by
33 posts views Thread by Diez B. Roggisch | last post: by
7 posts views Thread by Brian Burgess | last post: by
reply views Thread by Adam | last post: by
1 post views Thread by walterbyrd | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.