I have a iframe container whose iframe url property is set to open a pdf file in IFS. The pdf file opens fine in IE10 inside the iframe.
However, google chrome does not show the pdf file inside of the iframe. It just does not show anything neither gives any kind of msg (see attached).
Based on some free advice on the internet, I even enabled the Adobe Reader plugin in Chrome, however no luck.
Any suggestion to get around the problem!!!
Open PDF file in iFrame on Chrome
-
- New User
- Posts: 7
- Joined: Fri May 24, 2013 10:48 am
- First Name: Amar
- Last Name: Kumar
- Company Name: Alfa Insurance
- Phone: 6153122729
- State / Province: Tennessee
- Country: United States
- Contact:
Open PDF file in iFrame on Chrome
- Attachments
-
- iframe issue in Chrome.docx
- (502.61 KiB) Downloaded 339 times
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Open PDF file in iFrame on Chrome
Hmm... I'm certainly no expert, but... I don't think this is the proper way to embed a PDF in an HTML document, is it? An iframe is for loading another HTML page so that it's embedded in a larger HTML page.
Instead, try using an <embed> tag. To do that, drag an "html container" widget onto your canvas. Set its height/width to the size of the section of your page for the PDF (I used 375 and 500 for my test) and then set the html attribute of the html container (Note: make sure you use the html attribute, not the value attribute) to the following:
Obviously, change the URL to the right one for your PDF document, and make the height/width in the <embed> tag match the height/width of the HTML container.
<embed> is an official HTML5 way to do this... but it was around prior to HTML5 in all major browsers (Even though it wasn't a part of the standard yet) so should work for just about any browser out there, and should continue to work.
Does that work properly for you?
Instead, try using an <embed> tag. To do that, drag an "html container" widget onto your canvas. Set its height/width to the size of the section of your page for the PDF (I used 375 and 500 for my test) and then set the html attribute of the html container (Note: make sure you use the html attribute, not the value attribute) to the following:
Code: Select all
<embed src="http://www.adobe.com/enterprise/accessibility/pdfs/acro6_pg_ue.pdf" width="500" height="375">
<embed> is an official HTML5 way to do this... but it was around prior to HTML5 in all major browsers (Even though it wasn't a part of the standard yet) so should work for just about any browser out there, and should continue to work.
Does that work properly for you?
-
- New User
- Posts: 7
- Joined: Fri May 24, 2013 10:48 am
- First Name: Amar
- Last Name: Kumar
- Company Name: Alfa Insurance
- Phone: 6153122729
- State / Province: Tennessee
- Country: United States
- Contact:
Re: Open PDF file in iFrame on Chrome
Thanks Scott for the suggestion.
I got Access Denied in IE when I tried to embed the PDF. I learnt that the version 10 and beyond, the Adobe reader opens in a protected mode due to which the Access denied msg was reported.
With regards to Chrome, nothing showed up using the embed tag too.
My PDF file is residing in one of the IFS folder, therefore I have my src url defined as "file://server/folder/file.pdf" Do you see anything that I am missing that may be causing.
Would PUI download pgm be of any help?
I got Access Denied in IE when I tried to embed the PDF. I learnt that the version 10 and beyond, the Adobe reader opens in a protected mode due to which the Access denied msg was reported.
With regards to Chrome, nothing showed up using the embed tag too.
My PDF file is residing in one of the IFS folder, therefore I have my src url defined as "file://server/folder/file.pdf" Do you see anything that I am missing that may be causing.
Would PUI download pgm be of any help?
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Open PDF file in iFrame on Chrome
The "access denied" might be due to the use of a file:// URL?? I'm not sure if that's the case without trying other things, but it might be.
IMHO, you should not use file:// URLs. That's for accessing the user's local hard drive, and is really intended for users to access their own files (such as HTML files they are creating) from the browser. I would never do it in a production application... imagine if any web page you went to on the Internet could suddenly grab things off of your hard drive.
You could use the Profound UI download process to get to these files. That would make sense if you want to allow/disallow access based on their user profile, and have set up the IFS to check authorities based on the logged in user, etc. If these PDFs are publicly accessible (you don't need to restrict by userid), then I would just add an Alias into your httpd.conf, which would be simpler and quicker.
The pui download also can let you run RPG code when the request is made, which is useful if you want to generate the PDFs on the fly.
Tell me more about your situation and I'll be happy to make recommendations.
IMHO, you should not use file:// URLs. That's for accessing the user's local hard drive, and is really intended for users to access their own files (such as HTML files they are creating) from the browser. I would never do it in a production application... imagine if any web page you went to on the Internet could suddenly grab things off of your hard drive.
You could use the Profound UI download process to get to these files. That would make sense if you want to allow/disallow access based on their user profile, and have set up the IFS to check authorities based on the logged in user, etc. If these PDFs are publicly accessible (you don't need to restrict by userid), then I would just add an Alias into your httpd.conf, which would be simpler and quicker.
The pui download also can let you run RPG code when the request is made, which is useful if you want to generate the PDFs on the fly.
Tell me more about your situation and I'll be happy to make recommendations.
-
- New User
- Posts: 11
- Joined: Thu Oct 20, 2016 5:56 am
- First Name: silvano
- Last Name: pacifici
- Company Name: VIBA SPA
- State / Province: Outside Canada/USA
- Country: Italy
- Contact:
Re: Open PDF file in iFrame on Chrome
Hi akumar,
i'm interested in what you did.
Can you show me how you designed the iFrame for show an embedded pdf in it?
Thank you.
i'm interested in what you did.
Can you show me how you designed the iFrame for show an embedded pdf in it?
Thank you.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Open PDF file in iFrame on Chrome
It does not appear that Mr. Kumar is still visiting these forums. (The question is from 4 years ago.)
All you would need to do set the "iframe url" property to a URL that points to your PDF. As I mentioned above, you cannot use a file:// URL -- for security reasons, browsers will only allow file URLs when the HTML page was also loaded from a file url.
Hope that helps
All you would need to do set the "iframe url" property to a URL that points to your PDF. As I mentioned above, you cannot use a file:// URL -- for security reasons, browsers will only allow file URLs when the HTML page was also loaded from a file url.
Hope that helps
Who is online
Users browsing this forum: No registered users and 4 guests