I have a pdf generated invoice witch i like to display inline in the browser: link is for example: guest/view/invoice/vqhH8sujcOrpg0t2nF4WQExDLKXmYTNe No extension.
the below code gets a failed to load PDF document when i change it to attachment it works but give a download while i like to display it inline.
$file = site_url('guest/view/generate_invoice_pdf/' . $invoice_url_key);
$filename = 'factuur.pdf';
header("Content-type: application/pdf");
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
echo $file;