I have managed to use the below snippet of code, to open a pdf in a browser.Instead of opening in the same page, I would like it to open in a new browser tab.
I am not using an tag. This piece of code invokes a number of actions and at the end it is supposed to display the pdf. It works fine, but i would like it to open in a new tab.
Is this possible? and if so could you please explain to me how to do so.
Im using a Magento (EE 12.02) application and its on php 5.3.
$file = $pdf_file_path;
$filename = $file_name;
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
header('Accept-Ranges: bytes');
@readfile($file);