I have generated a html using wkhtml library and I have a href link in the pdf which should open in either new tab or new window. I have already gone over using window.open() , window.location.href , javascript function and also directly href. But these not works for me. May be I am not using as in proper way. Please this will be great to get answer from anyone.
Asked
Active
Viewed 210 times
-2
-
Possible duplicate of [Trying to get links in an embedded PDF to open in a new window](http://stackoverflow.com/questions/32228564/trying-to-get-links-in-an-embedded-pdf-to-open-in-a-new-window)? – TrojanByAccident Dec 27 '16 at 06:07
-
in href use `target="_blank"`. – Suchit kumar Dec 27 '16 at 06:07
-
I have already used this but not working for me. I have to click the link in pdf file and the location after click should open in window. I dont have to open pdf file. I am firing click event in pdf file not in browser. – kunal kumar Dec 27 '16 at 07:12
1 Answers
-1
Try this:
<a href="/link/to/pdf/file" target="_blank">Click here to view pdf in new tab</a>
target="_blank"
attribute opens the specified link new tab

Yajnesh Rai
- 290
- 1
- 6
- 17
-
I have already used this but not working for me. I have to click the link in pdf file not in browser and the location after click should open in window. I dont have to open pdf file. I am firing click event in pdf file not in browser. – kunal kumar Dec 27 '16 at 07:13