Saludos
Yo tengo un archivo llamado reporte.php
<?php require_once("vista/dompdf_config.inc.php");
$html = $_POST["reporte"];
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream($reporte.pdf);
Como pueden ver $html guarda una variable enviada a travez del metodo POST
El archivo con la funcion javascript tiene:
$("#btnVerPDF").click(function() {
var rep = $("#lista").html();
$.ajax({
type : "post",
url : "reporte.php",
data : {reporte:rep},
success:function(resultado){ }
return false; });
el problema es que este no genera un pdf
necesito ayuda
gracias
confirmaste que no genera un pdf?, no se como es la librería, pero la funcion stream hace un echo del pdf o lo guarda en archivo?
Cita de: cv_olehc en 13 Marzo 2015, 21:48 PM
$dompdf->stream($reporte.pdf);
Prueba a cambiar ese
$reporte.pdf por
"reporte.pdf", suponiendo que sea eso lo que buscas.
ya conseguí la documentación
Citarstream
Streams the PDF to the client. The file will open a download dialog by default. The options parameter controls the output.
Arguments:
string $filename: the name of the streamed file
array $options: accepted options are:
'compress' = > 1 or 0 - apply content stream compression, this is on (1) by default
'Attachment' => 1 or 0 - if 1, force the browser to open a download dialog, on (1) by default
primero cambia lo que
ivancea96 dijo... segundo, el pdf lo está retornando por la variable "resultado" de tu ajax