我在jspdf中遇到错误ERROR TypeError:“ t未定义”

时间:2018-12-24 12:37:23

标签: angular

import * as jsPDF from 'jspdf'

模板:

<button (click)="download()">download </button>

download() {

    var doc = new jsPDF();
    doc.text(20, 20, 'Hello world!');
    doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
    doc.addPage();
    doc.text(20, 20, 'Do you like that?');

    // Save the PDF
    doc.save('Test.pdf');

}

0 个答案:

没有答案