Re: LA PREGUNTA DEL MILLON....
| From: | Tomas V.V.Cox | Date: | Fri, 01 Sep 2000 14:40:55 +0000 |
| Subject: | Re: LA PREGUNTA DEL MILLON.... | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-1414@lists.php.net to get a copy of this message | ||
Benjamín Mesa Rodríguez wrote:
>
> Me he bajado el software y funciona bien, pero claro...¿cómo genero un
> script para crear el PDF una vez que tenga el documento HTML a partir del
> formulario PHP?... That's the question!!
>
A grosso modo, se me ocurre:
<?php
$a =<<<END
<html><body>
Hola soy la variable $foo<br>
</body></html>
END
$tmpfile = uniqid (rand());
if (!$fd = fopen ($tmpfile, "w")
die ("...");
fputs ($fd, $a);
fclose ($fd);
header ("Context-Type: application/pdf");
passthru ("htmldoc -t pdf --webpage $tmpfile");
unlink ($tmpfile);
?>
Niego toda responsabilidad sobre el daño que puedan causar estas lineas
y no garantizo que funcione en ningun caso :)
Saludos,
Tomas V.V.Cox