如何从 ckeditor 内容和数据生成 pdf?
how to generate pdf from ckeditor content along with data?
我正在尝试使用 TCPDF 生成 pdf 我必须解析 pdf 中的动态数据 html table 工作正常。
App::import('Vendor', 'tcpdf');
$tcpdf = new TCPDF();
//$tcpdf->SetHeaderData($header_logo, $header_logo_width, $header_title,
PDF_HEADER_STRING);
$textfont = 'freesans';
$tcpdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$tcpdf->AddPage();
$tcpdf->SetFont('dejavusans', '', 10, '', true);
$test = '
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="height:20px"></td>
</tr>
<tr>
<td style="text-align:center;">Test Report</td>
</tr>
<tr>
<td height="1"> </td>
</tr>
</table>
';
$test.="--- Dynamic Data----";
$html = <<<EOF
$test
EOF;
$filename="Test.pdf";
$tcpdf->writeHTML($html, true, false, true, false, '');
$tcpdf->lastPage();
//ob_end_clean();
$tcpdf->Output($filename, 'D');
上面的代码运行良好,但是当我解析 CKEditor 内容以及动态内容时,pdf 设计崩溃了。有一个单元格有 CKEditor 数据(任何数据内容 html) 当我试图生成 pdf 时,Pdf 设计崩溃了。
有没有办法生成好的格式来生成pdf。
尝试使用生成 pdf 的 php class MDFP 并观看此视频:
https://www.youtube.com/watch?v=fPbW7JhIZOQ
我正在尝试使用 TCPDF 生成 pdf 我必须解析 pdf 中的动态数据 html table 工作正常。
App::import('Vendor', 'tcpdf');
$tcpdf = new TCPDF();
//$tcpdf->SetHeaderData($header_logo, $header_logo_width, $header_title,
PDF_HEADER_STRING);
$textfont = 'freesans';
$tcpdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$tcpdf->AddPage();
$tcpdf->SetFont('dejavusans', '', 10, '', true);
$test = '
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="height:20px"></td>
</tr>
<tr>
<td style="text-align:center;">Test Report</td>
</tr>
<tr>
<td height="1"> </td>
</tr>
</table>
';
$test.="--- Dynamic Data----";
$html = <<<EOF
$test
EOF;
$filename="Test.pdf";
$tcpdf->writeHTML($html, true, false, true, false, '');
$tcpdf->lastPage();
//ob_end_clean();
$tcpdf->Output($filename, 'D');
上面的代码运行良好,但是当我解析 CKEditor 内容以及动态内容时,pdf 设计崩溃了。有一个单元格有 CKEditor 数据(任何数据内容 html) 当我试图生成 pdf 时,Pdf 设计崩溃了。 有没有办法生成好的格式来生成pdf。
尝试使用生成 pdf 的 php class MDFP 并观看此视频: https://www.youtube.com/watch?v=fPbW7JhIZOQ