-翼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
    关注

    @各位大神@各位大神

    评论

报告相同问题?

悬赏问题

  • ¥20 怎么在stm32门禁成品上增加记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 解riccati方程组