Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | apaudel96 |
I have a pdf file in my res:// folder. Let’s call it file.pdf.
The main scene has the following structure:
Control
–Button
with the following code:
extends Control
func _on_Button_pressed():
print("Button Pressed")
var error = OS.shell_open("file.pdf")
if error:
print(error)
else:
print("file.pdf opened")
This works as expected and opens the pdf file on PC (Ubuntu) but doesn’t open the file on android.
The debugger outputs:
Button Pressed
19
- I’ve also tested this with .png, .html, and a directory. These also work on PC but not on android.
- I’ve also tried granting read and write external storage permissions, still doesn’t work
- I tried an online pdf file with
OS.shell_open(“https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf”)
and it worked