The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> how to open a pdf file from html page?
rrn
post Jul 25 2009, 05:39 AM
Post #1


Novice
**

Group: Members
Posts: 21
Joined: 15-April 09
Member No.: 8,330



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies(1 - 5)
Frederiek
post Jul 25 2009, 06:44 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 25 2009, 11:15 AM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
rrn
post Jul 26 2009, 01:05 AM
Post #4


Novice
**

Group: Members
Posts: 21
Joined: 15-April 09
Member No.: 8,330



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"
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Jul 26 2009, 03:53 AM
Post #5


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Tom H.
post Jul 26 2009, 06:28 AM
Post #6


Advanced Member
****

Group: Members
Posts: 129
Joined: 24-August 06
Member No.: 14



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 12:54 AM