0

I am creating pdf using jsPDF & Html2PDF . Pdf is generating perfectly and also pdf is downloaded and saved on my pc as I click on button. But I also want to send PDF in mail when i click on submit.

This is the code for generating the PDF

 function generatePDF() {

        // Choose the element id which you want to export.
        $("#TitleHide_BE").attr("hidden", true);
        var element = document.getElementById('content2');
        element.style.width = '800px';
        element.style.height = '1100px';
        var opt = {
            filename: 'invoice.pdf',
            html2canvas: { scale: 1 },
            jsPDF: { unit: 'in', format: 'A4', orientation: 'portrait', precision: '10' }
        };



        // choose the element and pass it to html2pdf() function and call the save() on it to save as pdf.
        html2pdf().set(opt).from(element).save();
    }

How can i send this pdf as a attachment in mail

  • Why is this question tagged with php? Your question seems to only reference client-side technologies. I would like to see more clarity / scope-narrowing in this question. – mickmackusa Dec 26 '22 at 12:12
  • I tagged PHP because I want to send a email with pdf in attachment which is generated by html2pdf as it is You can tell me what u want to see in my code here is the link of the invoice which i want to send as a email when u click on download PDF Button https://blog.blurredego.com/invoice/ – Abdul Rehman Butt Dec 26 '22 at 13:33

0 Answers0