ソースをそのままコピーし、php がエンコードされた pdf を出力するセクションを、オンライン エンコーダーから取得した文字列に置き換えました。
生の pdf は 141kb で、エンコードされた文字列は 194,065 バイトで、URL としてはかなり大きい..
あなたと同じように、Chromeでも問題なく動作しました。同様に、Opera にはバーがありません。
そこで、iframe タグから type='application/pdf' 属性を削除しました。Chrome と Opera はどちらもファイルを表示しますが、IE9 は依然として拒否します。
念のため、javascript を使用して src を変更しようとしましたが、Opera/Chrome では問題ありませんが、IE では問題ありません。
過去に、私は php を使用してその場で pdf を作成し、iframe の src を GET パラメーターを使用して php ファイルの URL に設定するだけでした。これはIE6で問題なく動作しました(およびopera、chrome、およびff-モバイルデバイスで試したことはありません。5年以上前です)
私が役立つことを願っているいくつかの古いサンプルコード:
(1) iframeを挿入するJavascript
function showPdfTt(studentId)
{
var url, tgt;
title = byId("popupTitle");
title.innerHTML = "Timetable for " + studentId;
tgt = byId("popupContent");
url = "pdftimetable.php?";
url += "id="+studentId;
url += "&type=Student";
tgt.innerHTML = "<iframe onload=\"centerElem(byId('box'))\" src='"+url+"' width=\"700px\" height=\"500px\"></iframe>";
}
pdfTimetable.php の出力セクション
$pdfStr = $pdf->output();
$myFile = fopen("lastRequested.pdf", "wb"); // just here for debugging purposes
fwrite($myFile, $pdfStr);
fclose($myFile);
$pdf->ezStream(); // send output to stdout (the browser) - uses fpdf for generation
exit;
fpdf の出力セクション
if(php_sapi_name()!='cli')
{
//We send to a browser
header('Content-Type: application/pdf');
if(headers_sent())
$this->Error('Some data has already been output, can\'t send PDF file');
header('Content-Length: '.strlen($this->buffer));
header('Content-Disposition: inline; filename="'.$name.'"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression','0');
}
echo $this->buffer;
break;