How do you generate a pdf off line?

thanks, i’m new in ai2 so have to learn a lot of stuff …

opening a new screen every time was weird also for me but had not found the way to GO from a screen to another until now :wink:

still have problems with file path in my application, but i realized i miss a “;” in the jspdf “command” when adding the image, so now i can add the header logo and both signs at page bottom.

wheird think is that i can save the signs in the saveas method of the canvas with paths like that:
/DCIM/Camera/firmaispettore.jpg

i can delete the same images by command using the file delete method with paths like this:
/DCIM/Camera/firmaresponsabile.jpg

but cannot reload them back using the canvas set_backgroung_image method with the same path style: /DCIM/Camera/firmaispettore.jpg

so the trick is “not to miss the commas” in the jspdf commands :smiley:

Disculpa lograste terminar este proyecto me gustaria que me ayudaras resolver lo de la generacion del pdf con las 2 imagenes del canvas.

@allegfede espero una respuesa.
@TIMAI2 o si pudieras ayudarme para algo asi de este proyecto.

Follow this guide:

https://groups.google.com/g/mitappinventortest/c/LK-WCVRFUA4/m/Af_s-TVDBAAJ

Export (saveas) your canvas to an image
include your saved image in the pdf

@TIMAI2 mira ya genero un pdf con texto de un formulacion y capturo 2 firmas de las cuales se almacenan pero no tengo idea de como insertarlas el el documento PDF, pruebo algunos proyectos que estan en la guia que mandaste pero no me funcionan.

@TIMAI2 Si tuvieras algun ejemplo basico exportando una firma del canvas a un pdf me ayudarias mucho, me salvarias jeje.

https://puravidaapps.com/snippets.php#2canvassave

@TIMAI2 Me comentaron que tenia que pasarla a base64 y despues que el pdf la procese y la inserte en los ejemplos no mencionas algo de eso.

image

image

@TIMAI2 ok, lo probare, oye supiste si funciono el proyecto de allegfede.

Anyone who has much experience in java extension development can easily do.

@TIMAI2 oye puedes explicarme un poco mas, mira necesito que con un botón me la convierta en base 64 y de ahí me permita exportarla a un pdf.

I will make you up an example aia project....I have a few other things to do right now, but will get it done

@TIMAI2 Esta bien, lo que pasa es que aun no logro entender que bloque final me resultara para poder insertar en el pdf.

Estoy tratando de que ese mismo boton busque esa imagen por medio de la direccion y ala vez me la convierta a base 64 para yo poder insertarla al pdf.

image
@TIMAI2 Probe ese aia pero no me funciona sabes si tuvo alguna modificacion o sera en alguna direccion especifica(uso la sd interna)

Updates to various things have meant that my guide no longer works well. It can create a pdf but then the app crashes. I have not yet been able to fix it. However, I can offer an alternative that may suit your needs, thanks to @Juan_Antonio, who provides a created pdf extension for an arrangement. Attached is a simple example which allows you to draw on a canvas then save the output to a pdf.

createPDFCanvas.aia (10.0 KB)

I was unable to get the readPDF block to work for me, perhaps Juan can take a look and see why.

Extension probably needs an update to handle Android 10 file paths, perhaps just leave this up to the user / developer ?

Not on Android ≥ 10 devices. On my test device (Pixel 2XL, Android 11 - beta) the PDF is not saved (created) in the root folder of the external storage (or anywhere else).

Note:
The extension works with Kodular (also the .ReadPdf) so I assume that the extension has not yet been updated to the AndroidX libraries. Kodular has not been updated to AndroidX.

as per my final sentence....:wink:

The exension is able to handle Android 10 (even Android 11) file paths (→ Kodular). But it seems that it doesn't use (import) AndroidX libs.
Possibly there should be an additional AI2 extension (version).