나는 dompdf를 테스트하고 있습니다. 그리고 내가 만들고있는 것은 크롬에 의해 빨간색이 될 수 없다는 것을 알았습니다. 수마트라 pdf 리더기로 열려고했는데 열렸습니다. 내 전자 책에서 임의의 PDF 파일을 열어 보려고 시도했는데 빨간색이었습니다.크롬에서 dompdf를 통해 생성 된 PDF를 읽을 수 없습니다
<?php
require_once("dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$d_r = array(array('name'=>'ab', 'course'=>'bsit'), array('name'=>'yoh', 'course'=>'bscs'));
ob_start();
put_table($d_r);
file_put_contents('sample.html', ob_get_contents());
generate_pdf('sample.html');
function put_table($raw_data){
?>
<table border="1">
<tr>
<th>Name</th>
<th>Course</th>
</tr>
<?php foreach($raw_data as $data){ ?>
<tr>
<td><?php echo $data['name']; ?></td>
<td><?php echo $data['course']; ?></td>
</tr>
<?php } ?>
</table>
<?php
}
function generate_pdf($filename){
global $dompdf;
$dompdf->load_html(file_get_contents($filename));
$dompdf->render();
$dompdf->stream($filename. ".pdf");
}
?>
오늘까지. 크롬 PDF 뷰어는 Adobe의 것보다 낫습니다 ... 여기에서 나는 pdf를 생성 한 dompdf를 볼 수 있지만 Adobe에서는 "Error 135"를 얻습니다. – MarcoS