943,147 Members | Top Members by Rank

Ad:
Jan 25th, 2010
0

Linking to PDF documents from HTML

Expand Post »
I am trying to link a PDF document in HTML and I keep getting this error:

"Bad Request
Your browser sent a request that this server could not understand.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

My code is a simple link to a PDF document, however I think it needs to launch their PDF reader. How do I do that?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aslittell is offline Offline
10 posts
since Jan 2010
Jan 25th, 2010
0
Re: Linking to PDF documents from HTML
show the link code

You dont launch their reader,
they either have the reader set up to handle urls to pdf files or they will get the download prompt
Last edited by almostbob; Jan 25th, 2010 at 8:28 pm.
Reputation Points: 561
Solved Threads: 365
Posting Maven
almostbob is online now Online
2,966 posts
since Jan 2009
Jan 25th, 2010
0
Re: Linking to PDF documents from HTML
Ok, however when I just tried to open the link on my website it went to some cryptic code and didn't launch my adobe reader. It's almost as though the browser was trying to translate the PDF file.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aslittell is offline Offline
10 posts
since Jan 2010
Jan 25th, 2010
1
Re: Linking to PDF documents from HTML
thats why the first line is
"show the link code"
Reputation Points: 561
Solved Threads: 365
Posting Maven
almostbob is online now Online
2,966 posts
since Jan 2009
Jan 25th, 2010
0
Re: Linking to PDF documents from HTML
oh.. sorry I am really new to this whole thing and I've only done basic HTML websites.

HTML and CSS Syntax (Toggle Plain Text)
  1. <a href="Files/5GraphicDesignEssentials.pdf" target="_blank"><img src="Files/5GraphicDesignEssentials.jpg" style="position: absolute; left: 257px; top: 418px;" height="304px" width="254px"></a>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aslittell is offline Offline
10 posts
since Jan 2010
Jan 25th, 2010
0
Re: Linking to PDF documents from HTML
remove the target attribute and see if the pdf opens properly in the same page
seems dumb but pdf is a proprietary format and not all implementations in browsers work always

is this an html or xhtml page, if xhtml the image tag isnt closed
Last edited by almostbob; Jan 25th, 2010 at 8:57 pm.
Reputation Points: 561
Solved Threads: 365
Posting Maven
almostbob is online now Online
2,966 posts
since Jan 2009
Jan 25th, 2010
0
Re: Linking to PDF documents from HTML
It is html, and removing the target didn't help at all. It is still trying to convert the PDF to something readable in browser. It doesn't matter what browser I am using does it? I am using Firefox.

Here is the beginning part of what I'm seeing after clicking on the link:

HTML and CSS Syntax (Toggle Plain Text)
  1. %PDF-1.4
  2. %âãÏÓ
  3. 1 0 obj<</Metadata 282 0 R/Pages 2 0 R/Type/Catalog>>
  4. endobj
  5. 2 0 obj<</Count 1/Type/Pages/Kids[5 0 R]>>
  6. endobj
  7. 5 0 obj<</Parent 2 0 R/Contents 268 0 R/BleedBox[0.0 0.0 612.0 792.0]/ArtBox[14.5874 5.31738 570.832 716.0]/Group 269 0 R/MediaBox[0.0 0.0 612.0 792.0]/Thumb 281 0 R/TrimBox[0.0 0.0 612.0 792.0]/Resources<</XObject<</Im0 13 0 R/Im1 17 0 R/Im2 21 0 R/Im3 25 0 R/Im4 13 0 R/Im5 17 0 R/Im6 21 0 R/Im7 25 0 R>>/ColorSpace<</CS0 197 0 R>>/Font<</TT0 140 0 R/C2_0 147 0 R/C2_1 154 0 R>>/ProcSet[/PDF/Text/ImageC]/Properties<</MC0<</Color[20224.0 32768.0 32768.0]/Visible true/Editable false/Dimmed false/Preview true/Printed true/Title(Design)>>/MC1<</Color[20224.0 32768.0 32768.0]/Visible true/Editable true/Dimmed false/Preview true/Printed true/Title(Page 1)>>/MC2<</Color[20224.0 32768.0 20224.0]/Visible false/Editable true/Dimmed false/Preview true/Printed true/Title(Page 2)>>/MC3<</Contents 159 0 R/Resources<</XObject<</Im0 76 0 R/Im1 78 0 R/Im2 82 0 R/Im3 84 0 R/Im4 88 0 R/Im5 90 0 R/Im6 92 0 R/Im7 96 0 R/Im8 98 0 R/Im9 100 0 R>>/ColorSpace<</CS0 247 0 R/CS1 248 0 R/CS2 249 0 R/CS3 250 0 R>>/Font<</TT0 140 0 R/TT1 152 0 R/C2_0 142 0 R/C2_1 147 0 R/C2_2 154 0 R>>/ProcSet[/PDF/Text/ImageC/ImageI]/ExtGState<</GS0 251 0 R>>>>/AIType/HiddenLayer>>/MC4<</Color[20224.0 20224.0 32768.0]/Visible false/Editable true/Dimmed false/Preview true/Printed true/Title(Page 3)>>/MC5<</Contents 228 0 R/Resources<</XObject<</Im0 204 0 R/Im1 206 0 R/Im2 210 0 R/Im3 212 0 R/Im4 216 0 R/Im5 218 0 R/Im6 222 0 R/Im7 224 0 R/Fm0 187 0 R/Fm1 200 0 R>>/Shading<</Sh0 177 0 R/Sh1 188 0 R/Sh2 189 0 R/Sh3 190 0 R/Sh4 191 0 R>>/ColorSpace<</CS0 197 0 R/CS1 252 0 R/CS2 253 0 R/CS3 254 0 R/CS4 255 0 R/CS5 225 0 R/CS6 198 0 R>>/Font<</TT0 140 0 R/C2_0 142 0 R/C2_1 147 0 R/C2_2 154 0 R>>/ProcSet[/PDF/Text/ImageC/ImageI]/ExtGState<</GS0 256 0 R/GS1 257 0 R/GS2 258 0 R>>>>/AIType/HiddenLayer>>/MC6<</Color[32768.0 32768.0 20224.0]/Visible false/Editable true/Dimmed false/Preview true/Printed true/Title(Page 4)>>/MC7<</Contents 246 0 R/Resources<</XObject<</Im0 238 0 R>>/ColorSpace<</CS0 197 0 R>>/Font<</TT0 140 0 R/C2_0 142 0 R/C2_1 147 0 R/C2_2 154 0 R>>/ProcSet[/PDF/Text/ImageC]/ExtGState<</GS0 259 0 R>>>>/AIType/HiddenLayer>>>>/ExtGState<</GS0 6 0 R/GS1 260 0 R>>>>/Type/Page>>
  8. endobj
  9. 6 0 obj<</OPM 1/BM/Normal/CA 1.0/OP false/SMask/None/ca 1.0/AIS false/op false/Type/ExtGState/SA true>>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aslittell is offline Offline
10 posts
since Jan 2010
Jan 25th, 2010
1
Re: Linking to PDF documents from HTML
Bingo

pdf is a proprietary format,
and there is a known problem with firefox, there is a solution,
http://support.mozilla.com/en-US/kb/...within+Firefox
you can put the target back

>87% of potential users(those not using firefox + those who have patched firefox) will see the pdf as intended

**edit** If i were alert, that would have been the first question
IE bugs make news
FF bugs make fixes
Last edited by almostbob; Jan 25th, 2010 at 9:37 pm.
Reputation Points: 561
Solved Threads: 365
Posting Maven
almostbob is online now Online
2,966 posts
since Jan 2009
Jan 25th, 2010
0
Re: Linking to PDF documents from HTML
Thank you so much for your help!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aslittell is offline Offline
10 posts
since Jan 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Margin problem between <il>'s in IE 6
Next Thread in HTML and CSS Forum Timeline: Issues with embeding flash files in HTML





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC