Hola, sucede que estoy haciendo un código para generar PDF con DOMPDF, a la hora de intentar generarlo me suelta este error:
Unable to stream pdf: headers already sent
el código es el siguiente:
$html = '<table width="400" height="300" border="1" align="center" bgcolor="#FFFFFF">';
$html =$html. '<tr><td colspan="2"><center>Grupo oficina JM C.A.</center></td></tr>';
$html =$html.'<tr><td colspan="2"><center>Avenida Venezuela entre Calles 15 y 16</center></td></tr>';
$html =$html.'<tr><td colspan="2"><center>Barquisimeto Estado Lara</center></td></tr>';
$html =$html.'<tr><td colspan="2"><center>Telefono: 0251 2679314</center></td></tr>';
$html =$html.'<tr><td colspan="2"><center>RIF: J-31353985-6</center></td></tr>';
$html =$html.'<tr><td colspan="2"><center>Código de Licencia: L000005427</center></td></tr>';
$html =$html.'<tr><td><center>Fecha: '.date("d/m/Y",time()).'</center></td> <td><center>Código de factura: '.$_GET["id"].'</center></td> </tr>'; $html =$html.'<tr><td colspan="2"><center>Nombre: '.$_SESSION['MM_Username'].'</center></td></tr>';
$max_q = "select * from factura where id_usuario =".$_SESSION['MM_ID']." and id =".$_GET["id"].";";
if ($num > 0 )
{
$total = 0;
do
{
for ($i = 0; $i < count($arreglado); $i++)
{
$asd= "select nombre, precio from productos where id = ".(int)$arreglado[$i].";";
$total += $fix['precio'];
$html=$html. '<tr><td><center>'.$fix['nombre'].'</center></td>';
$html=$html. '<td><center>'.$fix['precio'].'</center></td></tr>';
}
}
$html=$html. '<tr><td><center>TOTAL</center></td><td><center>'.$total.'</center></td></tr></table>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("factura.pdf");
espero puedan ayudarme a arreglar ese molesto problema
un saludo y gracias de antemano