如何通过 php 脚本打印我的 html 文件?我只想在没有任何提示的情况下在后台运行它。我已经阅读了有关此的其他帖子,但仍然没有发现任何工作。我试过这个:
<?php
$dir = "temp"; // the folder that you are storing the file to be printed
$file = "file.html"; //change to proper file name
$file_dir = $dir.$file;
$server = "home_computer"; //name of the computer you are printing to on your network
$printer = "HP"; //printers shared name
$command = "print $file_dir /d:\\$server\\$printer";
exec($command) or die("File failed to print");
?>
在这里得到了这个例子http://www.phpfreaks.com/forums/index.php/topic,207946.0.html