Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I use a button to open a pdf file

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
What is the html (or JavaScript) that I write when an user clicks a button it will open a pdf file?

Thanks,
Rewdee
 
Here are two ways:

<form>
<input type=&quot;button&quot; onClick=&quot;window.location.href='filename.pdf';&quot; Value=&quot;View PDF File&quot;>
</form>
----------or for IE 5+--------------
<button type=&quot;button&quot; onClick=&quot;window.location.href='filename.pdf';&quot;>View PDF File</button>

Rick It's a pleasure to know that I've helped you. If I have,
please click the link below to let me know. :)
 
that will open in a different window.

to open inside your page use the following code

<embed src=&quot;file.pdf&quot; width=&quot;100%&quot; height=&quot;600&quot;></embed>
Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top