Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ how to open a pdf file from html page?

Posted by: rrn Jul 25 2009, 05:39 AM

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..

html4strict Code:

HTML Code:

CODE
<font color="#0000FF"><p align="center"><a href = 'map.pdf'>Location map</a></p></font>


will the above code work???

any help will be appreciated

Posted by: Frederiek Jul 25 2009, 06:44 AM

Yes, only the font color will not be applied to the link. The FONT tag is deprecated in HTML anyway in favor of CSS (Cascading Style Sheets). You can style links in CSS, using pseudo-classes. See Eric Meyer's article at http://meyerweb.com/eric/css/link-specificity.html.

You might want to open the PDF in another window. See the FAQ at http://htmlhelp.com/faq/html/links.html#new-window.

Posted by: pandy Jul 25 2009, 11:15 AM

QUOTE(rrn @ Jul 25 2009, 12:39 PM) *

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..

So what happens instead? Do you get some kind of error page? There's nothing wrong with the link, so maybe the URL to the file is wrong.




QUOTE
html4strict Code:


Afraid not. Neither FONT nor 'align' is in HTML Strict. But that doesn't matter for the functionality of your link. wink.gif

Posted by: rrn Jul 26 2009, 01:05 AM

QUOTE(pandy @ Jul 25 2009, 11:15 AM) *

QUOTE(rrn @ Jul 25 2009, 12:39 PM) *

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..

So what happens instead? Do you get some kind of error page? There's nothing wrong with the link, so maybe the URL to the file is wrong.




QUOTE
html4strict Code:


Afraid not. Neither FONT nor 'align' is in HTML Strict. But that doesn't matter for the functionality of your link. wink.gif



it is displaying "WEBPAGE CANNOT BE FOUND"

Posted by: Frederiek Jul 26 2009, 03:53 AM

Then the path to map.pdf must be wrong. Is it in the same folder as the html page where you call it from?
Or maybe you have forgotten to upload the pdf? wink.gif

Posted by: Tom H. Jul 26 2009, 06:28 AM

In your example code, try removing the spaces around the equal sign in your anchor tag, and I recommend double quotes instead of single quotes around the attribute value.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)