Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/05/2010, 13:39
MartinVillaH
 
Fecha de Ingreso: mayo-2010
Mensajes: 5
Antigüedad: 14 años
Puntos: 0
Respuesta: dompdf - no puedo hacer funcionar el ejemplo

error_reporting estaba comentado, ahora lo deje com E_ALL pero nada cambio.

aqui te paso el código, es una simple modificación al examples.php que provee dompdf


Cita:
<?php

require_once("../dompdf_config.inc.php");
if ( isset( $_POST["html"] ) ) {

if ( get_magic_quotes_gpc() )
$_POST["html"] = stripslashes($_POST["html"]);

echo $_POST["html"];
$dompdf = new DOMPDF();
$dompdf->load_html($_POST["html"]);
$dompdf->render();

$dompdf->stream("dompdf_out.pdf");

exit(0);
}

?>
<h2>Demo</h2>
<p>Enter your html snippet in the text box below to see it rendered as a
PDF: (Note by default, remote stylesheets, images &amp; are disabled.)</p>

<form action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
<div>
<textarea name="html" cols="60" rows="20">
&lt;html&gt;
&lt;head&gt;
&lt;style&gt;

/* Type some style rules here */

&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;p&gt; prueba &lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;
</textarea>

<div style="text-align: center; margin-top: 1em;">
<input type="submit" name="submit" value="submit"/>
</div>
</div>
</form>