Start a new topic.
Hi Juan,
Thank you for the excellent PDF writers.
Is it possible to print a long element as multiple PDF pages?
I have a "Web1" component in a VerticalArrangement,
The Web component displays a table,
The table can be very long. I would like to print multiple pages
page 1 height => from 0px to ~2000 px.
page 2 height => from ~2000px to ~4000 px.
page 3 height => from ~4000px to ~6000px.
Is this possible?
Deez
I can only think of doing manual Scroll.
Show list 0 ... 2000
Add pdf page 1
manual scroll
Show list 2000 ... 4000
Add pdf page 2
manual scroll
Show list
2000 ... 4000
Add pdf page 3
But how will it know of which text it should create a Pdf of
Hello Juan Antonio,
Is that possible to update the extension compitable with SDK>29. /mnt/sdcard/ prefix is not working for Android 10 and later.
Thanks
In this web page you can find the extensions com.KIO4_PdfS10.aix and com.KIO4_Pdf10.aix.
Files are saved in ...
/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/ ... in emulation with Companion.
And...
/storage/emulated/0/Android/data/'namepackage'/files/. .. when Built.
Can you test if they work for you?
http://kio4.com/appinventor/284C_extension_crear_pdf.htm
Thanks @Serkan_Duyan
On this website there is an extension called com.KIO4_Pdf10.aix, through this extension we can create pdf files in Android versions >= 10.
The created file will be saved in:
/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/ if you are in the MIT Companion emulator
and in
/storage/emulated/0/Android/data/'namepackage'/files/ if the application is installed (Build .apk)
You can get the path of that directory using the GetAndroidAppDirectory block.
Here a basic example.
borrar_createPdf_A10.aia (11.9 KB)
so if someone likes to create an app, which should work for all Android versions, both extensions have to be used? Can't you join the functionality and provide only one extension which works for all versions?
Taifun
Hello Taifun,
Actually it can be used for both, if they are set in ASD. Seems we need to pass all our APP's to ASD soon and I started to do that.
I have taken the easy way, I have joined the two extensions.
Now the extension is called com.KIO4_Pdf.aix, if you use the blocks that end in 10 (Create10, AddPage10 and Finish10) the files will be created in ASD, these blocks are appropriate to Android> = 10.
If you use the blocks that do not end in 10 (Create, AddPage and Finish) you will be able to choose other directories of the SdCard, these blocks are appropriate for Android <10.
Using the GetApi block, you can get the Android version of the device.
Example:
You can download the extension from:
http://kio4.com/appinventor/284C_extension_crear_pdf.htm
hi
it seems that the extension no longer saves in internal memory.
after updating my cell, it doesn't work.
first created the .pdf file
my GetApi returns 30.
I use the pdf10 function even when using the aia file downloaded on the kio4.com website it does not work.
someone has tried yet.
thank you
To work on Android 10+, you must use the Create10, AddPage10 and Finish10 blocks, the file the_pdf.pdf will be created in
/storage/emulated/0/Android/data/'namepackage'/files/
Thank you for your answer.
already use Create10, AddPage10 and Finish10 blocks.
but the file is not found.
also using the aia file referenced on the site, the comida.pdf file is not found.
I had no problems before.
in my opinion something has changed on version 11 api30
try to see this link
Problem with July 30 2020 Version: nb184 no longer able to write and read files - #50 by ewpatton anke
but I'm not an expert and maybe I'm wrong
Just built a project from scratch, and tested, using Companion app, on
Android 10 (genymotion emulator)
Android 11 (google pixel 4a)
PDF created OK with both.
Order of things:
- Show context
- Create the pdf
- Add a page
- Finish
- Read pdf to image component
Try my aia project. I have added a click event to the image, if you touch the image after reading the pdf you get the message, scroll the page to see the original vertical arrangement.
pdfA11.aia (12.0 KB)
i have try you new aia file, but, sorry no work for me.
strange because it worked well before.
if it can be useful to you. I have a samsung.
try to test on a samsung terminal.
thank you
Thanks @TIMAI2 for testing the extension.
I have tested Tim's code and it works for me on Android 9, MIT Companion and installed.
pdfA11_B.aia (12.0 KB)
ok the app reads the file created, but if I look for it, the file.pdf physically in my internal memory can't find it.
while before I saw the file.pdf.
is there any way to save it in Download?
thank you.