そこで、jQueryを介していくつかの値をサーバーに渡します。サーバーはPDFの文字化けを生成します。これは次のようになります。
$.post('/admin/printBatch',
data, // Some vars and such
function(data){
if(data) {
var batch = window.open('','Batch Print','width=600,height=600,location=_newtab');
var html = data; // Perhaps some header info here?!
batch.document.open();
batch.document.write(html);
batch.document.close();
$( this ).dialog( "close" ); // jQuery UI
} else {
alert("Something went wrong, dawg.");
}
return false;
});
出力ファイルはおおよそ次のようになります。
$pdf->AddPage(null, null, 'A PDF Page');
//....
$pdf->Output('', 'I'); // 'I' sends the file inline to the browser (http://fpdf.org/en/doc/output.htm)
ブラウザウィンドウに表示されるもの:
%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream ...
私は何か大きなものが欠けています、私はそれを知っています...考え?
みんなありがとう。