Problems rendering html in dompdf

0

Good morning,

I am trying to generate a pdf file through the DOMPDF library, using html and css.

$dompdf = new Dompdf();
$dompdf->loadHtml(utf8_decode($this->load->view('facturas/factura', $data, true)));
$dompdf->setPaper('A4', 'portrait');
$dompdf->set_option('isHtml5ParserEnabled', true);
$dompdf->render();
$dompdf->stream($FacturaId.'.pdf', array("Attachment" => false));

This is my html: link

The problem is that I receive this:

When should I receive this:

    
asked by 50l3r 21.03.2017 в 12:48
source

1 answer

0

I solved my problem using Libreoffice by command line:

$Path = APPPATH."media/Documentos/Facturas/pdf";
$FilePath = APPPATH."media/Documentos/Facturas/docx/Factura ".$FacturaId.".docx";

shell_exec(\"C:\Program Files (x86)\LibreOffice 5\program\soffice.exe\" --headless --convert-to pdf --outdir \"".$Path."\" \"$FilePath\"");

It requires having libreoffice installed on the server, but I have not managed to find another free option.

    
answered by 30.03.2017 в 15:18