我正在使用以下代码在 php 中生成 pdf,但是当我打开文件时它显示corrupted or damaged file
错误。
$FileName = date("d-m-y") . '.pdf';
$Content = "";
# Titlte of the CSV
$Content = "Name,Address,Age,Phone \n";
# fill data in the CSV
$Content .= "\"John Doe\",\"New York, USA\",15,65465464 \n";
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="' . $FileName . '"');
echo $Content;
exit();