Solved

View PDf in iframe

Posted on 2013-05-14
8
504 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
  • 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
 
LVL 1

Author Comment

by:ank5
ID: 39167018
Please find attached the HTML source from the browser.
Source.txt
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Page not loading properly 15 40
jquery light box autoplay video getuikit 5 50
Paper tearing animation 6 43
Bootstap Icons 3 22
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now