Create PDF file Extension. Layout to PDF

@juananton1991
Friend, I’m using your extension, but I can’t print the whole page …


I tried it as is as it is in your image and it did not work for me.

What should I do if I want to send the pdf to firebase or airtable for saving?

hey @kentleow1496 use cloudinary upload the file to cloudinary and save the returned url in firebase

The created PDF file size is too high, I created a page file still created a file size of 20MB, Plz help me with how to decrease this file size.
I want to convert the image to pdf format.
Thanks.

1 Like

but i dont have sdcard inserted in my phone, because my phone memory is enough then how can i store that generated file in /storage/emulated/0/myfolder directory? its internal storage…how to do that?

if someone is talking about an sdcard, then usually always the internal (emulated) sdcard is meant…

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

here are my blocks
according to this pdf file should be created in MyApp folder but it is not

try /MyApp/123.pdf
and you better use the ASD - application specific directory to store files…
which Android version are you using for your tests?

Taifun

1 Like

but ASD only work on mobiles having android 10 and above… my test device have android 11 but app is going to run on kitkat 4.4 . if i use ASD functions for now and at the time of giving to client use nonASD function then it would work?

Download new version if this extension
there is a block to know whether the device is running on android 10 or below it
I don’t know if it’s available on kodular or not but you can look it up here Create PDF file Extension. Layout to PDF - Extensions - MIT App Inventor Community


getAsdPath() returns storage/emulated/0/Android/data/io.makeroid.companion/files but but storage/emulated/0/Android/data directory is empty no io.makeroid.companion folder is present there

If you have Android<10, use the Create, AddPage and Finish blocks.
The pdf file will be saved in /mnt/sdcard (or /storage/emulated/0/)
[you can also change the directory, for example Download/my_file.pdf]

If you have Android>= 10 use the Create10, AddPage10 and Finish10 blocks, the file will be saved in /storage/emulated/0/Android/data/‘namepackage’/files/

(*) You can use the blocks: Create10, AddPage10 and Finish10 for all versions of Android.

Ejemplo_PDF.aia (32.6 KB)

2 Likes

So here, you use device utilities to check the android version. If it is <10, >=10 you can define the rule under same button click. No issue

I am using Android11 phone (MI A3). there is no directory in storage/emulated/0/Android/data … Also it does not ask to grant permission…

@juananton1991 you given example also not working no folder in Android/data

@Suraj_Salavi
if you add these blocks to Example_PDF.aia
you install the app and press the Button5, do you get /storage/emulated/0/Android/data/io.kodular.name.Example_PDF?
pdf_an11

API Android 10 = 29
API Android 9 = 28
https://en.wikipedia.org/wiki/Android_version_history

/storage/emulated/0/ or
file:///mnt/sdcard/ or
file:///storage/emulated/0/

Anyone method may work

1 Like

@juananton1991 Yes i get asdpath but dont know why it not shows in file explorer

These blocks works
a
but these not work

Difference is just he used two buttons to do two actions and i used single, does continuous blocks executes on different threads instead of on main thread itself in kodular ? how can i solve this