After iOS8 upgrade, safari can't display PDF in iframes again

It shows the first page of the loaded PDF file in the iframe, but where is the rest of the PDF file? (and yes, I need the iframe, since I need space to the right of it)


I NEED A QUICK FIX, my customers can't use my website 😟


Any of you have a suggestion?


A frustrated developer

iPad 2 Wi-Fi + 3G, iOS 8

Posted on Sep 22, 2014 12:20 AM

Reply
18 replies

Sep 22, 2014 9:27 AM in response to brianfromhaderslev

brianfromhaderslev wrote:


It shows the first page of the loaded PDF file in the iframe, but where is the rest of the PDF file? (and yes, I need the iframe, since I need space to the right of it)


I NEED A QUICK FIX, my customers can't use my website 😟


Any of you have a suggestion?


A frustrated developer


You may be able to manually adjust the height of the iframe (via CSS) to show all the pages of the PDF. I have not tried this myself, though.

Sep 22, 2014 10:23 AM in response to hokie_coder

hokie_coder wrote:


I've tried that on my app when I ran into this issue. The contents of the missing pages are still missing and increasing the iframe height just shows you more blank white space.


Yes, I just noticed that after testing. 😟 The only other possibility that I can think of to work around this is to break the PDF into individual files for each page, then you could use either <iframe> or <img> tags to render each page individually.

Sep 22, 2014 10:45 AM in response to ddkilzer

Note that this issue only reproduces in the Modern WebKit API (WKWebView) which is now used by Safari. Offline web apps (after saved to the Home screen) and WebSheet (the app used for captive Wi-Fi networks) still use UIWebView, so they are not affected by this bug.


Other web browsers which still use UIWebView continue render the full PDF in an iframe as expected.

Oct 1, 2014 1:42 PM in response to brianfromhaderslev

In my application, I generated the PDFs that I was trying to display in an iframe from HTML that I also generated. It was a print preview screen for printing documents from an Ipad. We had to update our iframes to instead show this generated HTML for the preview and then use the PDF for actually printing the document. Using this approach also allowed us to be able to scroll through the document with one finger on the Ipad. This only works if you have the HTML which is used to create the PDF document though, which may not be the case for everyone.


TLDR;


If you generate PDFs from HTML code, you can instead write the HTML into the iframe's #document to show it to the user in iOS8


Below is a link to a blog post showing how this is done:

http://www.zomeoff.com/javascript-how-to-load-dynamic-contents-html-string-json- to-iframe/

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

After iOS8 upgrade, safari can't display PDF in iframes again

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.