Reputation: 49
I want to print directly a pdf from a url.
I tried window.open(url) but it suggest me to save it. (Because of the .pdf) I just want to print the url directly
Any ideas or suggestions?
Thanks
Upvotes: 0
Views: 6864
Reputation: 1718
To display the file in the same tab of the browser you can use:
window.open(url, "_self");
Or also you can try:
window.location.assign(url);
If by printing you mean in a printer you can use http://printjs.crabbly.com/
Upvotes: 2
Reputation: 499
You have to open the file first in new tab and from there you can download or you can show in same page and from there also you can download
<html>
<head>
</head>
<body>
<div class="row">
<div class="col-lg-12">
<div id="pdfdiv">
<a class="media" href="./yourPdfFIleLocation.pdf">Click Me</a>
</div>
</div>
</div>
</body>
Upvotes: 2