Skip to content

Instantly share code, notes, and snippets.

@davidnormo
Last active May 17, 2022 16:56
Show Gist options
  • Save davidnormo/5e39fb9bbe026e12c3da to your computer and use it in GitHub Desktop.
Save davidnormo/5e39fb9bbe026e12c3da to your computer and use it in GitHub Desktop.
jsPDF as email attachment
var pdf = new jsPDF();
pdf.text(0, 0, 'Hello World!');
var pdfBase64 = pdf.output('datauristring');
window.plugin.email.open({
to: ['[email protected]'],
subject: 'New PDF!',
body: 'Hi there, here is that new PDF you wanted!',
isHTML: false,
attachments: [pdfBase64]
});
@sunny7899
Copy link

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