Please, how do I create a downloadable pdf file from information filled by a user?

Thanks for the answer, I am not sure I captured the code process well, how do I get the Email ID and test this email since it is not on any wix plan?

Email from wix triggered email


Website code

export async function pdfButton_click ( event ) {

const pdfUrl = await getPdfUrl ({ name , address , number , startdate , subreference , plan , years , amount , validity , reference })
wixLocation . to ( pdfUrl );

wixCRM . createContact ({ 

“firstName” : $w ( ‘#text1860’ ). text , //first name of exixting user from login contact list to help wix recognise the user
“emails” : [ $w ( ‘#text1861’ ). text ], //email of this existing user from login contact list to help wix recognise the user

})
. then (( contactId ) => {
wixCRM . emailContact ( “EMAIL ID” , contactId , {
“variables” : {
“contact.Name.First” : $w ( ‘#text1858’ ). text , // Name from a different database not contact list
“invoice-number” : itemrr . reference ,
“preview-link” : pdfUrl //the pdf link
}
})

. then (() => {

})
. catch (( err ) => {

});
});
}