次のコード スニペットは、「DOMPDF を使用して PDF をレンダリングする」を示しています。ここで、2 つの質問があります。
1.CSSコードを追加する場所は?
2.シングルコードの外にHTML コードを作成する方法 ( $html変数を参照)?
事前に感謝し、助けてくれて本当にありがとう.
<?php
require_once("dompdf_config.inc.php");
$html =
'<html><body>'.
'<p>Hello World!</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("hello_world.pdf");
?>