Reputation: 5585
I have a bordered area inside my iframe . The code is like this :
<div>
<center>
<div style="width:600px;height:245px;border:3px solid grey;">
</div>
</center>
</div>
This creates a bordered grey area inside my iframe . Now i want the user to view the pdf when he just opens the iframe inside the bordered area having vertical and horizontal scrollbars. The pdf is housed in this url :
http://www.irs.gov/pub/irs-pdf/fw4.pdf
How can i do this ? Kindly help .
Upvotes: 0
Views: 131
Reputation: 1213
Alternatively , if you don't want to use frame you can inlude pdf as an object. A question that you might think right now(which usage?) is asked here Why people use <object classid=""> to show PDF instead of src="1.pdf"
Typical usage is below;
<!--[if IE]>
<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="http://www.irs.gov/pub/irs-pdf/fw4.pdf">
<p>backup content</p>
</object>
<![endif]-->
<!--[if !IE]> <-->
<object type="application/pdf" data="http://www.irs.gov/pub/irs-pdf/fw4.pdf" style="width:100%; height:100%">
<p>backup content</p>
</object>
<!-->
<![endif]-->
You may take a look at here for usages and css issues for other types of object elements. http://joliclic.free.fr/html/object-tag/en/index.php
Upvotes: 1
Reputation: 173
Just pass the pdf url in iframe src value:
...
<center>
<iframe runat="server" src="http://www.irs.gov/pub/irs-pdf/fw4.pdf "
width="600px" height="245px" id="iframeDash" frameborder="1" >
</center>
...
Upvotes: 0