I created inside override the tools folder and I put us dompdf-master found here https://github.com/dompdf/dompdf.
Instead inside override/classes/pdf i copied PDFGenerator.php, there is in classes/pdf.
In PDFGenerator.php add:
require_once('/../override/tools/dompdf-master/dompdf/Dompdf.php');
require_once('/../override/tools/dompdf-master/autoload.inc.php');
include('/../override/tools/dompdf-master/dompdf/dompdf_config.inc.php');
use DompdfDompdf;
use DompdfOptions;
The class becomes:
class PDFGenerator extends DOMPDF
Eliminates the render() function and replace it with:
public function render($filename, $display = true)
{
if (empty($filename)) {
throw new PrestaShopException('Missing filename.');
}
$html = $this->header.$this->content.$this->footer;
//die($html);
$options = new Options();
$options->set('A4','potrait');
$options->set('enable_css_float',true);
$options->set('isHtml5ParserEnabled', true);
$dompdf = new DOMPDF($options);
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream($filename);
}
Then i deleted cache/class_index.php
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…