DOMpdfとCodeigniterを使用してPDFファイルを作成しようとしています。コントローラーに次のスクリプトがあり、コントローラー内にDOMフォルダーを保持しています。しかし、スクリプトを実行すると、致命的なエラーメッセージが表示されます。
しかし、モデルからコントローラーにあるDOMPDFの$htmlに値を送信すると..pdfを生成できます。
このエラーを取り除く方法を教えてください。
include_once('dompdf/dompdf_config.inc.php');
$html= $this->load->view('view_pdf');
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper("a4", "landscape" );
$dompdf->render();
$dompdf->stream("my_pdf.pdf", array("Attachment" => 0));
これは私のビューファイルです;
<html>
<head>
<style>
#header { position: absolute; left: 0; top: -50px; right: 0; height: 140px; text-align: center; }
#footer {position: fixed ; left: 0px; bottom: -20px; right: 0px; height: 30px; font-size:10; }
#footer .page:after { content: counter(page, upper-roman); }
#table-6 {
width: 100%
border: 1px solid #B0B0B0;
}
#table-6 tbody {
/* Kind of irrelevant unless your .css is alreadt doing something else */
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
#table-6 td {
padding: 3px 10px;
font-size: 12px;
font-weight: normal;
text-align:center;
}
#table-6 tr:nth-child(even) {
background: #F2F2F2;
font-size: 12px;
font-weight: normal;
}
</style>
</head>
<body>
This is a test
</body>
</html>