I have the following problem: I would like to print something automatically via PHP on the localhost on Windows.
$commandText = '"C:\\Program Files (x86)\\FOXIT SOFTWARE\\FOXIT READER\\FoxitReader.exe" /t '.$target.' "'.$printer.'"';
file_put_contents("print.txt", $commandText);
exec($commandText);
When I run the script like this, the content is printed rotated by 90°. If I copy the content of $commandText manually to the command line, it prints it correctly.
I tried exec(...) and shell_exec(...) - without any difference. I tried "PDFprinter" instead of "FoxitReader" as well - exact the same behavior. I tried different printers - no difference.
Does anyone have any ideas what else I could try? Thanks a lot!