I am struggling to figure out a method to take an HTML page and convert it to a pdf and then turn that pdf into a base64.
Specifically, I am working on making an client-side webpage where a user can fill in information about an invoice and then click a "send email" button this button should take the entire invoice page and convert it to a pdf. I then need to use emailjs to send the pdf to a client. To my understanding emailjs requires attachments to be in base64 form so I think I would need to convert the pdf to base64 in order to attach it.
All of this needs to be done client side and with vanilla js. Any ideas or examples on how I could accomplish this would be greatly appreciated!