[英]DOMPDF Wordpress nothing happens
I have a problem with DOMPDF integration into Wordpress. 我将DOMPDF集成到Wordpress中时遇到问题。
Here are the steps done: 这是完成的步骤:
Here is the code: 这是代码:
require_once(echo get_template_directory_uri()."/dompdf/dompdf_config.inc.php");
$html =
'<html><body>'.
'<p>Put your html here, or generate it with your favourite '.
'templating system.</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream(echo get_template_directory_uri()."/dompdf/testpdf.pdf");
Outputs nothing, I have also tried stream("testpdf.pdf"); 什么都不输出,我也尝试过stream(“ testpdf.pdf”); as the last line but no success. 作为最后一行,但没有成功。
Any ideas? 有任何想法吗? Thank you. 谢谢。
Try this 尝试这个
include get_template_directory() . '/dompdf/dompdf_config.inc.php';
$html =
'<html><body>'.
'<p>Put your html here, or generate it with your favourite '.
'templating system.</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html( $html );
$dompdf->render();
file_put_contents( get_template_directory() . "/dompdf/testpdf.pdf");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.