This is a bit niche, hoping someone can help.
I’m using DOMPDF to convert HTML into PDF files – nice piece of kit using existing library infrastructure. However, when I specify the ‘set_paper’ method it goes completely mental, sucking CPU out of existence and crashing. Odd, to say the least. It works when you do not specify this.
Code:-
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper('a4', 'landscape');
$dompdf->render();
file_put_contents('data.pdf', $dompdf->output());
Considering it works when in portrait and not landscape, it probably has to do with a table being taller than one page. There is a bug that causes DOMPDF to crash if a table extends beyond one page. Either surround the content with another element like a div, or break the table apart into several tables.