want to display pdf in php so i created following code
$file = '../public/'.$ref;
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
@readfile($file);
but browser showing weird contents , like below image
i changed Content-Disposition in to attachment, its working fine but no luck in inline what i can do to fix this issue thanks in advance
finally code is working , i comment following lines in bootstrap.php file
public static function sendResponse(Zend_Controller_Response_Http $response)
{
//$response->setHeader('Content-Type', 'text/html; charset=iso-8859-1', true);
$response->sendResponse();
}
but i need this charset in my response header , there is any other method?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.