i am creating a website in html page , i want to open a pdf file from my html page.. ie in my website there is a link to location map, wen i click the the 'location map ' , a pdf file should be opened.. tried a lot of ways, pls help me.. <font color="#0000FF"><p align="center"><a href = 'map.pdf'>Location map</a></p></font> HTML: will the above code work??? any help will be appreciated
Try it and see. Yes, a simple href should be all you need. As long as Adobe Reader or Foxit is installed on the user's computer, the browser should know what to do with it.
no , it is not working.. i tried the folloing code 1. <HTML> 2. <HEAD> 3. 4. <script type="text/javascript"> 5. function open_win() 6. { 7. window.open("http://wwwtest.com/map.pdf","_blank"); 8. } 9. </script> 10. </HEAD> 11. <form> 12. <input type="button" onclick="open_win()" value="Location map"> 13. </form> 14. </BODY> 15. </HTML> HTML: this is also not working.. wen i click the button , a new window is opened but it is displaying a message ' requested URL not found ' ..
If you simply want to link to a PDF, then use href. No need for JS. <a href="yourpdf.pdf">Click here</a>
Then the problem is with your href then. What's the url of the pdf? If you copy and paste it into your browser, and get an error, then there is no pdf at that location.
yes your script works just fine I tested it with a /pdf site I found. just get a valid link and you should be good