iOS PDF in iFrame (mobile safari) is a mess

Dear Apple community,


I am struggling with PDFs embedded in iFrames for a long time.


Here is a sample I created to showcase the problem.


https://lemniscus.de/pdf_print_test.html


Just open this link on desktop and mobile safari. You will immediately notice, that mobile safari does only show the first page. If you debug, you will see that the PDF is not embedded as PDF: safari is creating and showing an image instead of the real PDF.


It is impossible to scroll to further pages, and it is impossible to print the pdf (printing only prints the image, not the pdf).


If one needs to print the PDF, the PDF must be opened fullscreen (in a new tab), but this does not work if you are starting the webapp from the home screen.


There are some stackoverflow postings and some blogs commenting the issue:


https://stackoverflow.com/questions/15480804/problems-displaying-pdf-in-iframe-on-mobile-safari

https://stackoverflow.com/questions/53558808/pdf-in-iframe-only-first-page-on-iphone-ipad

https://stackoverflow.com/questions/38325655/pdf-link-showing-only-one-page-inside-iframe-ipad-only


This issue has been around for a while and is a real pain for web developers who need to preview/ print PDFs.


I already asked this question a long time ago without any solution.





iPad Pro 11-inch Wi-Fi, Cellular

Posted on Jan 9, 2019 4:08 PM

Reply

Similar questions

There are no replies.

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.

iOS PDF in iFrame (mobile safari) is a mess

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