Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/10/2013, 06:37
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 1 mes
Puntos: 574
Respuesta: Como covertir html en pdf con dompdf que no se descargue

Código PHP:
Ver original
  1. <?php
  2.  
  3.  
  4. require_once("dompdf/dompdf_config.inc.php");
  5.  
  6. $code = '<html><head><title>Hola</title></head>
  7. <body><h1>Hola Mundo</h1></body></html>';    
  8.  
  9. $dompdf = new DOMPDF();
  10.  
  11. $dompdf->load_html($code);
  12.  
  13. ini_set("memory_limit","32M");
  14.  
  15. $dompdf->render();
  16.  
  17. $dompdf->stream("mipdf.pdf", array("Attachment" => 0));
  18. ?>

Aqui dicen esto

Cita:
Q: How can I make PDFs open in the browser window instead of opening the download dialog?
A: This is controlled by the "Attachment" header sent by dompdf when it streams the PDF to the client. You can modify the headers sent by dompdf by passing additional options to the $dompdf->stream() function:
__________________
Quim
--------------------------------------------------
Ayudar a ayudar es una buena práctica!!! Y da buenos resultados.

Última edición por quimfv; 09/10/2013 a las 06:48