Create a pdf file and save it on the device automatically


#1

Hi everyone. I state that I’ve read several posts, but I haven’t been able to find a solution to what I’m looking for.
I need to create a pdf and save it on the device.
I am using an html page which contains a javascritp code which I reproduce below, with which I create a pdf file.
My need is to save the file that is created from this html page, automatically, without the intervention of those who are using the app.
Can anyone suggest which component I can do this with? I tried with webviewer and web, but I couldn’t.
Report below the html code I am using, thanks to all.

"script src=“https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js”>

function creaPdf3() { var doc = new jsPDF(); doc.setFont("Times New Roman"); doc.setFontType("normal"); doc.setFontSize(20); doc.setTextColor(0, 0, 0); doc.text(20, 20, 'Ordine di prova numero xxx'); doc.text(20, 30, 'Cliente yyyyy'); doc.text(20, 40, '_______________________________'); doc.text(20, 50, 'Articolo 1 quantità 2'); doc.text(20, 60, 'Totale documeto'); doc.addPage(); doc.text(20, 20, 'Seconda pagina'); // Save the PDF doc.save('provapdf.pdf'); } </script"