The following code is not working:
$html = "<h1> WELCOME TO PHP Dompdf </h1>";
use Dompdf\Dompdf;
ob_get_clean(); // Clear Buffer - this is very important!!!
$document = new Dompdf();
$document->loadHtml($html);
//$document->setPaper('A4', 'portrait');
$document->setPaper("A4", "$orientation");
$document->render();
$document->stream("Payslips", array("Attachment"=>0));