0

以下のコードを実行すると、ブラウザは自動的に PDF ドキュメントをダウンロードします。そのPDFを開くと、エラーを下回っています。

ここに画像の説明を入力ソース から以下のスニペットのアイデアを得ました

<?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";
?>
4

0 に答える 0