The Dark Knight
The Dark Knight

Reputation: 5585

How to show a pdf inside a bordered area?

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

Answers (2)

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

Arun Manjhi
Arun Manjhi

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

Related Questions