set('isHtml5ParserEnabled', true); $options->set('isRemoteEnabled', true); $dompdf = new Dompdf($options); // ๐Ÿ“„ แƒจแƒแƒ‘แƒšแƒแƒœแƒ˜แƒก HTML แƒฉแƒแƒขแƒ•แƒ˜แƒ แƒ—แƒ•แƒ ob_start(); require_once realpath(Config::basePath() . '/admin/modules/billing/models/invoices/invoice_template.php'); $html = ob_get_clean(); $dompdf->loadHtml($html, 'UTF-8'); $dompdf->setPaper('A4', 'portrait'); $dompdf->render(); // ๐Ÿ“„ PDF-แƒ˜แƒก แƒจแƒ”แƒœแƒแƒฎแƒ•แƒ แƒ“แƒ แƒแƒ”แƒ‘แƒ˜แƒ— $pdfOutput = $dompdf->output(); $pdfPath = '/tmp/invoice_' . $invoice['id'] . '.pdf'; file_put_contents($pdfPath, $pdfOutput); // แƒ’แƒแƒ“แƒแƒ›แƒ˜แƒกแƒแƒ›แƒแƒ แƒ—แƒ”แƒ‘แƒ แƒแƒœ แƒฉแƒแƒ›แƒแƒขแƒ•แƒ˜แƒ แƒ—แƒ•แƒ แƒจแƒ”แƒ’แƒ˜แƒซแƒšแƒ˜แƒแƒ— แƒ“แƒแƒแƒ›แƒแƒขแƒแƒ— แƒแƒฅ