The current pdfJS Viewer Reactive doesn't work on iOS/Safari because Safari doesn't support the new proposal for javascript for private methods among other things.
Basically, the provided build/pdf.js and web/viewer.js don't work.
I've looked at transpiling them with babel, and packing them with webpack. But I'm not that experienced with this. Would it be something you, or someone else, could resolve? Would be great if iOS/Safari would work as well.
Hello Michel,
Safari should work with private methods, but it seems you need to use an updated version of it.You can check with versions implement it here: https://caniuse.com/?search=private%20field
I don't work on this project anymore, but this component is just a wrap around Mozilla's project, so I don't think there is much the team actually working on this component can do about it. Every change to the code here creates a problem to update it to newer versions.But maybe the active developers may have something different to say about it.Cheers!
It turned out that my corporate phone somehow never updated, so indeed my iOS version was too old (14).
Somehow I missed that, I guess assumptions make you blind ;-) Thanks for the tip.
It does load the document correctly. Now only to figure out why it's only showing up with a height of around 10px on iOS...
To answer my own question about the height that was not okay, I found the following thread: https://stackoverflow.com/questions/34320046/iframe-height-issues-on-ios-mobile-safari
The solution of Freya Yu worked for me. I wrapped the component in a DIV, and added the following style properties:
-webkit-overflow-scrolling: touch;height: 100vh;min-height: 100%;overflow-y: scroll;width: 100vw;
Now it shows up correctly on iOS/Safari as well.