Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/01/2011, 11:06
Avatar de Manuellama
Manuellama
 
Fecha de Ingreso: noviembre-2006
Ubicación: Zafra, Extremadura, Spain, Spain
Mensajes: 174
Antigüedad: 17 años, 5 meses
Puntos: 10
Respuesta: Pasar número de copias a imprimir

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>copies</title>

<script>function printer(contents){
document.write(document.getElementById("printthis" ).innerHTML);
window.print() ;
}</script>
</head>
<body>

<?php
$pages = 5;
$getcontents = file_get_contents("print.html");
for ($i=0;$i<$pages;$i++){
$getcontents.= $getcontents."<br><br><br>";
}


?>
<div id="printthis"><?php echo $getcontents?></div>
<button onclick="printer();">Printer </button>
</body>
</html>


Utiliza ese código html/php/js...


$pages = 5;
$getcontents = file_get_contents("print.html");

La variable pages te indica el número de veces que vas a imprimir print.html

Cambia esos valores por los que quieras.