I need to open a pdf file in new browser tab. How to do this. I was using
var docLocation = '../downloads/doc.pdf';
window.open(docLocation,"resizeable,scrollbar");
But it opens a download dialog box of the browser. How to achieve this ?
var docLocation = '../downloads/doc. pdf'; window. open(docLocation,"resizeable,scrollbar");
Opening a PDF document in Chrome is simple, whether you use Mac or Windows. Right click on your PDF document. Click on 'Open with'. Select Chrome or your browser of choice.
This code will open a pdf document in a full window from JavaScript
var pdf = MyPdf.pdf;
window.open(pdf);
A function to open windows would look like this:
function openPDF(pdf){
window.open(pdf);
return false;
}
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