Estoy tratando de usar una herramienta que se llama HTMLDOC , para generar archivos pdf desde php. Es muy facil de usar y hay documentacion en el website:http://www.easysw.com/htmldoc/
El problema es que yo estoy tratando de usarla desde php y estoy haciendo lo que dice en la documentacion pero al usarla no logro generar mi archivo pdf.
Si no que me abre un archivo pdf con esto:
Content-Type: application/pdf Content-Length: 1832 Content-Disposition:
inline; filename="htmldoc.pdf" Accept-Ranges: none X-Creator: HTMLDOC
1.8.24 Commercial %PDF-1.3 %âª¡Ó 1 0 obj<>endobj 2 0 obj<
Este es el codigo que estoy usando, primer creo un archivo en php como normalmente se hace, y el cual es creado correctamente:
Código PHP:
$filename = "temp_file.html";
$fp = fopen($filename, "a+");
fwrite($fp, "$data");
fclose($fp);
Código HTML:
<a name="save" href="save_pdf_file.php" target="_self">Click here to save bibliography as PDF</a>
Código PHP:
<?php
// putenv("HTMLDOC_NOCGI=yes");
$options = "";
function topdf($filename, $options) {
# Write the content type to the client...
header("Content-Type: application/pdf");
flush();
# Run HTMLDOC to provide the PDF file to the user...
passthru("htmldoc -t pdf --quiet --jpeg --webpage $options '$filename'");
}
$filename="temp_file.pdf";
topdf($filename,$options);
?>
Llevo 3 dias sin ningun exito , yo estoy usando IIS6 en windows. Por favor alguna ayuda seria muy apreciada
Gracias