Code: Select all
<head>
<script language="javascript">
function printEm(){
setTimeout('window.print()',1000);
}
</script>
</head>
<body onLoad="javascript:printEm()">
<?php
$dir="theseDocs/";
$openDir=opendir($dir);
while(false !=($file= readdir($openDir))){
if(!preg_match('/^\./',$file)){
$readFile=fopen($dir.$file,'r');
$contents=fread($readFile,1000);
echo($contents."<br>");
}
}
?>
</body>Why? our internal intranet generate weekly reports that are created in pdf...there are about 12 reoorts each week, and having to click, open, print, "back" ,click, open, print , "back" has finally taken its toll! The alternative would be if php could just send the data to the printer, and forego opening all together...but is that really possible???