Php 什么也没发生
我在将DOMPDF集成到Wordpress时遇到问题 以下是完成的步骤:Php 什么也没发生,php,wordpress,dompdf,Php,Wordpress,Dompdf,我在将DOMPDF集成到Wordpress时遇到问题 以下是完成的步骤: 安装 进入主题IR/dompdf/ 创建了路径/dompdf/lib/php字体库/类,其中要创建php库 进口的 已导入“FontLib”文件夹内容 ()进入 /dompdf/lib/php字体库/classes 代码如下: require_once(echo get_template_directory_uri()."/dompdf/dompdf_config.inc.php"); $html = '&l
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");
require_once(echo-get_-template_-directory_-uri()“/dompdf/dompdf_-config.inc.php”);
$html=
''.
“将你的html放在这里,或者用你最喜欢的内容生成它”。
“模板系统。”。
'';
$dompdf=新的dompdf();
$dompdf->load_html($html);
$dompdf->render();
$dompd->stream(echo get_template_directory_uri()。“/dompd/testpdf.pdf”);
不输出任何内容,我也尝试了stream(“testpdf.pdf”);作为最后一行,但没有成功
有什么想法吗?谢谢。试试这个
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");
包含获取模板目录()/dompdf/dompdf_config.inc.php';
$html=
''.
“将你的html放在这里,或者用你最喜欢的内容生成它”。
“模板系统。”。
'';
$dompdf=新的dompdf();
$dompdf->load_html($html);
$dompdf->render();
文件内容(获取模板目录()“/dompdf/testpdf.pdf”);
为什么函数调用中写入了echo
?把它拿走echo
removed仍然不起作用。在函数中尝试使用绝对url也没有成功PDF 0.6.1使用php字体库0.3.x。您应该复制存储库中的目录结构(如果您试图节省空间,可以删除“字体”和“www”目录)。此外,stream()
方法调用应该只包含文件名,例如$dompdf->stream(“testpdf.pdf”)代码>