-翼Y- 2017-08-15 11:07 采纳率: 0%
浏览 1873

jsPDF 进行模块化开发遇到的问题

自己写了一个例子可以用,但是在加入项目用fis2编译的时候就报错了,错误如下:
[NOTIC] can't find dep resource [buffer]

[NOTIC] can't find dep resource [buffer]

[NOTIC] can't find dep resource [buffer]

[NOTIC] can't find dep resource [buffer]

[NOTIC] can't find dep resource [buffer]
,而且在跑项目的时候找不到html2canvas。
jspdf.debug.js:1746 Uncaught Error: You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js
at Object.jsPDFAPI.addHTML (jspdf.debug.js:1746)
at HTMLButtonElement.toPDF (maintain_resource_list.js:79)
at HTMLButtonElement.dispatch (jquery.js:2376)
at HTMLButtonElement.elemData.handle (jquery.js:2141)

代码如下:
JavaScript code
?
1
2
3
4
5
6
7
8
9
10
11
12
13
require("components/jsPDF/html2canvas.js");
require("components/jsPDF/jspdf.debug.js");

var pdf = new jsPDF('p', 'pt', 'a4');
pdf.internal.scaleFactor = 1;
var options = {
    pagesplit: true
};
var printhtml = $(".table").get(0);
pdf.addHTML(printhtml, options, function() {
    pdf.save('web1111.pdf');
});

求大神指点一下是哪里出了问题,而且在jsPDF中的addHTML 方法是在哪里初始化了 html2canvas?

  • 写回答

1条回答 默认 最新

  • -翼Y- 2017-08-15 13:22
    关注

    @各位大神@各位大神

    评论

报告相同问题?

悬赏问题

  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?