How do I open a PDF file in a new window (using the native viewer) ? #13652
-
HI all, n00b here. I've been looking at https://v2.tauri.app/plugin/opener/ but I can't quite figure out what the limitation for IOS/Android means in this documentation I have written UI code below that works fine in the browser but I've no idea what the correct Tauri 2.0 equivalent is that will work on IOS & Android devices. How would I open this PDF in a new window in the native viewer? Would I write the contents first to some locally declared path? I tried different combinations of security policies, several plugins but to no avail. I've tried calling invoke to a rust function and using openPath from the opener plugin but still no luck. It's all much too embarrassing to post here. Any help would be greatly appreciated! This is my UI code.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
How does that code behave on mobile? Does it not do anything?
It means that you can only give website urls (like If window.open doesn't work, I don't think there's a solution for you at the moment unless you're okay with writing objective-c / kotlin code. Ideally we can extend the opener plugin to support files as well, which shouldn't be that complicated (for those with a bit of experience in that field) but i can't allocate time for that at the moment. |
Beta Was this translation helpful? Give feedback.
How does that code behave on mobile? Does it not do anything?
It means that you can only give website urls (like
https://google.com
to the plugin, which will open them in the device's default browser). No local files etc allowed. This is about the plugin's methods alone, the defaultwindow.open
is unrelated to the plugin.If window.open doesn't work, I don't think there's a solution for you at the moment unless you're okay with writing objective-c / kotlin code. Ideally we can extend the opener plugin to support files as well, which shouldn't be that complicat…