How to open Pdf files

I saw many users asking questions related to Pdf.
So in this guide I am going to tell you that how you can open pdf in your app without any extension.
First of all thanks to @Taifun for guide on his website.
https://puravidaapps.com/snippets.php#2pdf

First you need some components.

  • Textbox
  • Button
  • Webviewer
  • Activity Starter
  • Web (to decode uri)

How it looks from designer

Blocks
1.Open PDF from given path

2.Pick PDF and open it
blocks%20(9)

3.Load a PDF online from URL
blocks%20(12)

Aia and Apk
Looking for AIA file, get it here:
http://sunnythedeveloper.epizy.com/2019/09/01/how-to-open-pdf-files/

Want to test Apk?
Here is a test apk:
Pdf.apk (5.1 MB)

Last updated 2019-08-31T18:30:00Z

And this will not work if you change package name

/Boban

1 Like

Any solution for that?
I think I have not read things correctly.

Hi Boban

Actually who is bringing Apps from others platform need to change the package name to continue using the same publication on Play Store. I’m thinking about. Thanks for the answer.

thank you for getting some inspirations from my work
How to view a pdf document

your example will work only on your development device, because the activity starter is not able to access files from the assets of your app
therefore you first have to copy them to the internal sdcard and access them from there

Taifun

1 Like

Thanks for your reply.
I want to ask then how to open PDF from sdcard?
How the PDF readers work?
If this is solved then it will be very useful.

To open those PDFs, you have to copy the file from sdcard to a hidden .folder (create a new in internal storage) and remove the spaces from its name (TaifunPDF foes NOT support spaces in name!).

see here

Taifun

1 Like

Hi everyone, I need to open a pdf file and view it for the full size of the page. The pdf file must be taken from the resources (assets). I purchased the taifun extension but can’t get it to work. Can someone help me? Do I need a web viewer? what blocks should i use?

What about trying the example project to find out how to use the extension?

Taifun

1 Like

The extension project does not work. Returns “PDF file does not exist” for any selection

Please build the project to find out, that it is working…

to open a file from the assets using the Kodular companion app unfortunately does not work like I prepared the example… this is because our friends at Kodular had the great idea to use the folder /Makeroid rather than /AppInventor to store the assets for the companion app…

For the companion app you can use an if-then-else block to access a file in the assets as shown in the CopyAsync method of the following example by @bodymindpower

Taifun

1 Like