Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

View PDf in iframe

Posted on 2013-05-14
8
Medium Priority
?
511 Views
Last Modified: 2013-05-26
I have an iframe within a page which is supposed to load a pdf. There is a link on the main page, which when clicked by the user will load the pdf in an iframe in the same page.

For some reason this does not happen. iframe is not able to load the pdf. The URL that is being generated is correct as when I type the PDF URL in another browser window, it gives me an option to open/save the pdf.

<iframe border="no" scrolling="yes" width="400" height="500" marginheight="0" marginwidth="0" src="http://server:8000/MyApp/application/document/'+widgets.result_list.selected_row.id

Open in new window


Is there a way to enforce this behavior?
0
Comment
Question by:ank5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39165200
I need to see the render code for the page. Post a link to it please.

Cd&
0
 
LVL 1

Author Comment

by:ank5
ID: 39165217
It's not in public domain, so link won't work.

Will it help, if I post the HTML source?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39165649
It would be better if I could see rendered code.  If you display the page in your browser and view source you should be able to save that an post it.  

I am trying determine what the browser is actually seeing for the link in the scr because the quoting looks incorrect.

Cd&
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:ank5
ID: 39167018
Please find attached the HTML source from the browser.
Source.txt
0
 
LVL 1

Author Comment

by:ank5
ID: 39167075
I figured out that I was missing a closing double quote for the src attribute and that was causing the problem. Now the <iframe> does display, but when I click on the link it downloads the file, instead of opening it in the <iframe>. Is there a way to get around this?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39169035
Okay, you are probably using IE.  to support pdf in IE you will probably need to use: http://pdfobject.com/


Cd&
0
 
LVL 1

Author Comment

by:ank5
ID: 39187108
I'm using Chrome
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 2000 total points
ID: 39188714
AFAIK the Chrome pdf viewer is not compatible with iframe.  

You could try putting the pdf in an html page and loading the html page into the iframe.

Cd&
0

Featured Post

Quick Cloud Training

Looking for some quick training on the cloud in 2 hours or less? Check out these how-to guides in AWS, Linux, OpenStack, Azure, and more!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question