Zend framework Zend PDF-要打开而不是保存吗

Zend framework Zend PDF-要打开而不是保存吗,zend-framework,Zend Framework,am使用Zend_pdf生成pdf 创建后保存 我想打开它而不是保存 当我直接访问url时,我找不到直接打开PDF的方法,因此我改为: <?php // Save PDF into file $oPdf->save("./pdfcache/filename.pdf"); // Set headers header('Content-Type: application/pdf'); header('Content-Disposition: inline; filename=filen

am使用Zend_pdf生成pdf

创建后保存

我想打开它而不是保存


当我直接访问url时,我找不到直接打开PDF的方法,因此我改为:

<?php
// Save PDF into file
$oPdf->save("./pdfcache/filename.pdf");

// Set headers
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename=filename.pdf');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression','0');

// Get File Contents and echo to output
echo file_get_contents("./pdfcache/filename.pdf");

// Prevent anything else from being outputted
die();
使用render()方法

// Set PDF headers
header ('Content-Type:', 'application/pdf');
header ('Content-Disposition:', 'inline;');

// Output pdf
echo $pdf->render();