Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/09/2013, 05:44
marcwolf
 
Fecha de Ingreso: junio-2010
Mensajes: 353
Antigüedad: 13 años, 10 meses
Puntos: 6
Imprimir pdf desde un boton html

Hola,
he estado buscando cómo imprimir un pdf desde un botón pero no he encontrado la manera, he provado;

1-http://www.position-absolute.com/creation/print/ -> imprime pagia en html pero si esta contiene un iframe con un pdf , se ve en blanco.

2-También probé este código

<?php
require('pdf_js.php');

class PDF_AutoPrint extends PDF_JavaScript
{
function AutoPrint($dialog=false)
{
//Open the print dialog or start printing immediately on the standard printer
$param=($dialog ? 'true' : 'false');
$script="print($param);";
$this->IncludeJS($script);
}

function AutoPrintToPrinter($server, $printer, $dialog=false)
{
//Print on a shared printer (requires at least Acrobat 6)
$script = "var pp = getPrintParams();";
if($dialog)
$script .= "pp.interactive = pp.constants.interactionLevel.full;";
else
$script .= "pp.interactive = pp.constants.interactionLevel.automatic;";
$script .= "pp.printerName = '\\\\\\\\".$server."\\\\".$printer."';";
$script .= "print(pp);";
$this->IncludeJS($script);
}
}

$pdf=new PDF_AutoPrint();
$pdf->AddPage();
//$pdf->SetFont('Arial','',20);
$pdf->Text(90, 50, 'Print me!');
//Open the print dialog
$pdf->AutoPrint(true);
?>

Y si que imprime un pdf , pero con los datos que le paso , amí me gustaría pasarle un archivo .pdf y que haga lo mismo es posible?

gracias de antemano