Uncaught TypeError - When trying to send a PDF by email with jsPDF

0

I want to send a PDF file by email with the javascript library jsPDF. When I run I have this error.

Uncaught TypeError: Cannot read property 'email' of undefined

This is the code:

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]
});
    
asked by Cesar Velasquez 28.05.2018 в 16:53
source

0 answers