[FREE] Create PDF file Extension. Layout to PDF

Runtime Error java.io.FileNotFoundException: /storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/roopak1.pdf (No such file or directory) Note: You will not see another error reported for 5 seconds.


When i'm saving .txt file, it works without error. When i'm saving component as image or pdf using extensions it is showing error.

can anyone help me why am i getting this error?

What Android version are you running ?

Does this only happen when running in companion app ?

it happened after built app also.
but it works in another app in same version with same method. Even both app in legacy mode.

:question:

currently i'm testing in Android Version:9

OK.

This location:

/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files

is only valid when using the companion app, files will not be stored there with a compiled app.

On android 9 and below, the default file location for a saved pdf is:

/storage/emulated/0/

On android 10 and above you should be using the "10" blocks, for example:

image

which will save the pdf to the ASD:

/storage/emulated/0/Android/data/<package name>/files

I am surprised to read that you say it works in another app, it should really not be possible to copy a file from one ASD to another ASD for another app, (it may be possible in companion with extensions...)

Perhaps explain what it is you are trying to achieve, and we can point you in the right direction...

You might also want to read the documentation here:

http://kio4.com/appinventor/284C_extension_crear_pdf.htm
( you can translate the page to English, or possibly to your preferred language)

Thanks
i'll try

Hi, first of all very nice and useful extention.
The extension works perfectly when I share pdf with telegram or Drive but when I use WhatsApp to share the file is corrupted . I used the 10 blocks, there is a Bin notation

Show your relevant blocks



Have you tested/viewed the pdf before sharing ? (Also do this outside of the app on your device)

If that is OK, then there must be an issue with the sharing activity (to WhatsApp). I do not use WhatsApp so cannot help with that.

1 Like

Thanks for your reply.
I found the error, there was a space at the end of the name .pdf(space)
Probably whatsapp doesn't able to fix and manage this extra space but telegram and Drive yes.
The pic helps me to see the space :sweat_smile:

1 Like

After selecting filescope to legacy, I'm getting error 908.

How is this related to this pdf extension?
What about providing a screenshot of your relevant blocks?
Which Android version are you using for your tests?

Taifun

The PDF extension does not recognise any filescope settings. You use the plain blocks if Android version is < 10 and the "10" blocks if android version is >= 10.

I want to display a pdf/html content in my app.
When I was looking for a solution, I came upon this extension. Imported the AIA file to test in my device. I didn't make any changes to the code. My android version is 14.

Do you want to create a pdf, or simply view a local or online pdf that already exists?

view online pdf/doc files

For online files it is easiest to use the webviewer and the google document viewer url:

(courtesy puravidaapps)

1 Like

Is this how you use it? I tried it earlier but It won't download: