From what i understood i have to use some javascript code to make the trick, but what i cannot understand is if the js have to be loaded/stored somewhere OR have to be hardcoded in some "strings" of the block section
There is an html file (containing the javascript) in the assets of the app. This remains static, no changes necessary (unless you want to…).
If you look in the blocks you will see the webviewstring being set. This is for demo purposes only, but is the place where you let your imagination run wild, and code accordingly.
As advised in that post, you will need to read up on the syntax for the two plugins (jspdf and jspdf-autotable)
Thanks Tim for your support.
Analyzing your demo code i made a simple pdf, but now i have a problem.
I set an image on the pdf TOP, using the KIO4_base641.fileToString pointed to the logo_file, and this fires the KIO4_base641.GotString code (that gives commands to the js library).
So i replace the “pdf commands section” that was inside the KIO4_base641.GotString block with a separated procedure and i add 3 variables to store the “fileToString” calls of 3 separated KIO4 extensions
… so not the pdf generation was started by a button click that fires KIO4_base641.fileToString (for logo)-> KIO4_base642.fileToString (for the sign) -> generatePDF_procedure
and in that procedure i use the strings i store in the 2 variables.
For your immediate problem of creating a pdf, you have the call to “compilePDF” in the wrong place. You need to call it AFTER you have set the string like this:
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
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
@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.