How to send generated PDF from javascript to Servlet.
Hello Team,
I have generated pdf based user inputs through javascript using pdfmake library, now i have to send email with generated pdf to customers. I am able send mail with pdf using smpt.js library but due to some security concerns its not recommended. Now I am thinking to send/post the generated pdf to backend (servlet class ) & send using acs commons email api.
Tried with below scenarious,
1. I tried sending pdf as Base64 from js & decode the same in servlet using java.util.Base64. getDecoder.decode(String) - getting Illegal exception.
2. attaching pdf object to formData() object (as key- value) sending to servlet through ajax, still getting data as empty.
Can please helpn me is there any to achieve this.
Thanks in Advance