RE: I want to open a pdf file in app inventor

Hi Taifun,

I want to open a pdf file in app inventor. I installed this app (App Inventor Tutorials and Examples: Pick a file | Pura Vida Apps) on my phone (Android 13), but after picking a pdf file, this app is not able to open a pdf file. I see only message: "unfortunately there is no pdf reader installed on this device".

Please help me to fix this app for devices with Android 13.

Jozefko

Thats an old solution and probably outdated meanwhile...

Try the filepicker component instead

http://ai2.appinventor.mit.edu.ezproxy.canberra.edu.au/reference/components/media.html#FilePicker

Taifun

Also the latest version of my pdf extension offers a method, which could be interesting for you...

Taifun

Thank you for help, but I am not able to open and read a pdf files.

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

GoogleOCRFinal.aia (160.0 KB)
I want to change app GoogleOCRFinal. I want to add searching the pdf files in storage of phone and sending selected pdf file to OCR. I am not able to set the path of pdf file for OCR.
Please help me.

Do you simply want to send a pdf file to Google for OCR, or do you also want to view the pdf file before sending it to Google for OCR ?

Are the pdf files owned by your app, or do they come from another source?

Where are the pdf files stored on your device ?

Note the example aia project you are using is out of date for Android 13

Hi Timai2,
Just send the pdf file to Google for OCR recognition. I don't want to view the pdf file. The files are stored in the phone's internal memory in the Documents folder (not in the application).
Don't worry that the example aia project is out of date for Android 13.
Please help me.

In addition, I looked at your blocks and didn't find any blocks that access the /Documents folder.

I would suggest that the easiest thing to do is use SAF to pick a file from /Documents and copy it to your ASD. Then you know you have read/write for your app on that file. Then you can run the GoogleOCR on it.

Using SAF should ensure that you can access any file from your /Documents folder, regardless of whether your app created / owns the file or not.

ref

Hi Timai2,
SAF is complicated for me. I need easier solution.

Do you plan to publish your app in Google Play?
If not, try

Taifun

Download all your pdfs using your app into your ASD.

Hi Taifun, I installed apk file from this extension, but it did not work. I need something easy, because I only want to pick the pdf file from external memory and to send to Google OCR.

what about answering the question?

and in case it does not work, what about elaborating in that thread How to request and grant MANAGE_EXTERNAL_STORAGE permission
which apk file exactly did you try? what happens? what should happen instead... etc... etc

Taifun

Hi Timai2,
problem is that, I do not know all my pdfs which will be saved in future into my phone. I will want to use only some pdfs in my app, not all.

I do not see what difference that makes, you are selecting a pdf either from your shared directories or your ASD before sending it for OCR...