Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: HTML PDF Link
I've got a doc going to a conference where there may not be internet access (egads, you say!) So, I saved a few asp.net pages to a thumb drive (using the full htm), edited the menu hyperlinks so the menu links pointed to the thumb drive's local directory. Made sure the css for the tab images pointed locally, etc. But, I have a hyperlink on a page to a pdf on the thumb drive. The hyperlink will NOT open the pdf. I've tried a regular hyperlink, I've also tried the javascript onclick=top.window.open approach and can't get it to open. When I browser the thumb drive and click it directly, everything opens fine. Just to be sure I hadn't done anything really stupid, I copied the name of the file into the html hyperlink. Any help?
 
[Edit - Moved OPs answer here - Henry]
Okay, BTW I also tried the straigh href hyperlink. residentManual.pdf is in same root folder as file.
<form id="aspnetForm" name="aspnetForm" action="hos_policies.aspx?a=0" method="post">
<div>
<div id="maincontainer">
<div id="contentwrapper">
<div id="contentcolumn">
<div class="contentinnertube">
<h1>Graduate Medical Education</h1>&lt;img id="ctl00_ContentPlaceHolder1_Image3" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid" alt="Resident Photo" src="hos_policies_files/photoFHCPeds.jpg" align="right"&gt;
<a href="#" önclick="top.window.open ('residentManual.pdf','800x300','toolbar=no,scrollbars=yes,resizable=yes,status=no,location=no,menubar=no,directories=no,width=800,height=300')">Resident Manual  (pdf)</a>
</img></div>
</div>
</div>
</div>
</div>
</form>
 
[/Edit]
Posted 9-Feb-11 10:04am
Edited 9-Feb-11 10:34am
Henry Minute223.9K
v2
Comments
Manfred R. Bihy at 9-Feb-11 15:11pm
   
It would help tremendously if you posted the relevant saved HTML that contains said link to that ominous PDF. If it ain't to big I'd say post all of it, but the interesting bits shouldn't be more than 30 lines though. So you should try to make a cut down copy of what you have that suffices to reproduce your issue.
Henry Minute at 9-Feb-11 15:35pm
   
OP has responded. I have moved their answer into the question.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Where is the PDF file? In the root folder? deep under folder? Did you miss a path?
 
Did you specify absolute or relative path? Show us the code man!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi Janet!
 
There is a &ouml; (ö) instead of the o in onclick. That will not definitely not work.
 
<a href="#" onclick="top.window.open ('residentManual.pdf','800x300','toolbar=no,scrollbars=yes,resizable=yes,status=no,location=no,menubar=no,directories=no,width=800,height=300')">Resident Manual  (pdf)</a>
 
You might want to try this though:
 
<a href="./resident.pdf" target="pdf">Resident Manual</a>
 
If the pdf is in the same folder as the saved html it should work.
 
Cheers!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

The code is perfect except the wired characters.
Please check the pdf path.
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 250
1 George Jonsson 175
2 Jochen Arndt 150
3 Kornfeld Eliyahu Peter 149
4 PIEBALDconsult 110
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 9 Feb 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100