Hi can I ask some help please, I have modal and it will display pdf my pdf has 2 pages . it works in browser I can scroll to next page.but when I tried to ipad it only show 1 page and I cannot scroll the pdf to go to next page.
<div class="modal fade bd-example-modal-xl" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<h5 class="modal-title">My PDF</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<embed src="path/to/my/pdf" style="width: 100%;height: 560px;border: none;">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
Thank you in advance
There seem to be many similar questions on Google and not many answers. It does seem to be a problem in ios.
To be honest I don’t have any knowledge of this issue but of you have a demo to look at I can test and see if it does scroll on my iphone etc.
Otherwise you could detect for touch with js and then don’t embed the pdf but simply link to the pdf in the usual way.
Hi paul here is the sample of modal
here is my pen
Thank you in advance.
I don’t really understand it but there’s an article here that suggests doing this.
<iframe src="https://docs.google.com/gview?url=https://classics.berkeley.edu/sites/default/files/2020-01/sample.pdf&embedded=true" style="width: 100%;height: 560px;border: none;"></iframe>
That seems to make it work for me on the iphone and indeed on Safari Mac (which was also broken).
Thanks for the link I read the link and I put this code
<div style="overflow:scroll !important; -webkit-overflow-scrolling:touch !important;">
<iframe src="path/to/mypdf" style="width: 100%;height: 560px;border: none;"></iframe>
when I viewed it on Ipad 768x1024. only 1 page I can’t scroll also I remove the embed because my pdf cannot be found., but in mackbook safari works fine I can scroll.
In my android phone strange behaviour when modal shows , there is a button “open” and if I click the button it will open the pdf but not inside in the modal.
It seems the important part is the url that I added.
src="https://docs.google.com/gview? then the link to your pdf with embedded=true at the end
Did you check my codepen on your ipad?
Your original did not work in Safari on the mac desktop but my codepen works in both iphone and desktop safari.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.