Solved

View PDf in iframe

Posted on 2013-05-14
8
510 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
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

623 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