+2 votes

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


in Engine by (14 points)

1 Answer

+1 vote

I was also facing these issues earlier but then I found that the path with " res:// " isn't accessible in Android .
Instead save it in " users:// " as there you can access it even in Android.

by (109 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.