Skip to content

Instantly share code, notes, and snippets.

@davidnormo davidnormo/main.js
Last active Dec 15, 2017

Embed
What would you like to do?
jsPDF as email attachment
var pdf = new jsPDF();
pdf.text(0, 0, 'Hello World!');
var pdfBase64 = pdf.output('datauristring');
window.plugin.email.open({
to: ['to@email.com'],
subject: 'New PDF!',
body: 'Hi there, here is that new PDF you wanted!',
isHTML: false,
attachments: [pdfBase64]
});
@ajdeguzman

This comment has been minimized.

Copy link

ajdeguzman commented Mar 2, 2015

Thanks for this code..Do you know how to use the jspdf output pdf file as an attachment in an email using phpmailer?

@maiarar

This comment has been minimized.

Copy link

maiarar commented Dec 26, 2016

Thanks for this code! :)

@magesh7j

This comment has been minimized.

Copy link

magesh7j commented Feb 6, 2017

This Code will not send any mail. Let me explain little briefly

@florisdegraaff

This comment has been minimized.

Copy link

florisdegraaff commented Apr 11, 2017

windows.plugin is now deprecated. How can I add the pdf as a attachment at this moment?

@sunny7899

This comment has been minimized.

Copy link

sunny7899 commented Aug 24, 2017

Yes, windows.plugin is deprecated. what are the alternatives of this please anyone can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.