Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/07/2012, 21:50
thezzin
 
Fecha de Ingreso: septiembre-2008
Mensajes: 350
Antigüedad: 15 años, 8 meses
Puntos: 31
Respuesta: Generar PDF a partir de página con PHP

Con fpdf (www.fpdf.org/) podes generar un pdf desde un file html o php pero
el correcto es html porque en php tenes que convertirlo a html.

Código PHP:
<?php
require('html2fpdf.php');
$pdf=new HTML2FPDF();
$pdf->AddPage();
$fp fopen("sample.html","r");
$strContent fread($fpfilesize("sample.html"));
fclose($fp);
$pdf->WriteHTML($strContent);
$pdf->Output("sample.pdf");
echo 
"PDF file is generated successfully!";
?>
__________________
╬-----╬
║☺₧☻║
╬-----╬