A link that contains a .pdf such as the following opens in a new tab:
<a target="_blank" href="http://somePDF.pdf">Download</a>
Is it possible to make a Powerpoint file, .ppt, open in a new browser tab instead of making the user download the file?
I have tried this the following but this makes a user download the file:
<a target="_blank" href="http://somePPT.ppt">Download</a>
I am not sure if this is possible and have not been able to find any information on it so I am posting here.
If the user's browser isn't able to display the file and has no plugin that can display the file, it will offer the file as a download.
If you can export the PowerPoint slides to PDF or HTML, they are more likely to be displayed in the browser.
you could check if the browser has installed an pdf plugin, and if not use pdf.js to convert your pdf into an html page.
could look like this:
function hasPDFPlugin() {
for(var i = 0; i < navigator.plugins.length; i++) {
if(navigator.plugins[i].name.toLowerCase().indexOf('pdf') >== 0) {
return true;
}
}
return false;
}
if(!hasPDFPlugin()) {
// do the pdf.js stuff
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With