PHP无法以PDF格式编写内容

时间:2013-07-06 02:22:41

标签: php pdf pdf-generation

执行以下代码后,浏览器自动下载PDF文档。当我打开PDF时,我的误差低于。

enter image description here 我从source

获得了以下片段创意
<?php
$filename = "yourfilename.pdf";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Transfer-Encoding: binary");
echo "my contents should display in PDF Document";
?>

0 个答案:

没有答案