[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 517
  • Last Modified:

View PDf in iframe

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
ank5
Asked:
ank5
  • 4
  • 4
1 Solution
 
COBOLdinosaurCommented:
I need to see the render code for the page. Post a link to it please.

Cd&
0
 
ank5Author Commented:
It's not in public domain, so link won't work.

Will it help, if I post the HTML source?
0
 
COBOLdinosaurCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ank5Author Commented:
Please find attached the HTML source from the browser.
Source.txt
0
 
ank5Author Commented:
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
 
COBOLdinosaurCommented:
Okay, you are probably using IE.  to support pdf in IE you will probably need to use: http://pdfobject.com/


Cd&
0
 
ank5Author Commented:
I'm using Chrome
0
 
COBOLdinosaurCommented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now