【问题标题】:TypeError: this.internal.getCurrentPageInfo is not a function in jspdfTypeError:this.internal.getCurrentPageInfo 不是 jspdf 中的函数
【发布时间】:2017-11-02 11:32:26
【问题描述】:

当我尝试使用 jspdf 将 html 表转换为 pdf 时,出现此错误:

TypeError: this.internal.getCurrentPageInfo is not a function

这里使用相同的代码https://codepen.io/someatoms/pen/adojWy

我参考了https://github.com/simonbengtsson/jsPDF-AutoTable/blob/master/examples/examples.js#L142

【问题讨论】:

    标签: jspdf jspdf-autotable


    【解决方案1】:

    codepen 示例使用的是旧版本的 jspdf。现在通过更新到最新版本来修复 codepen 示例。

    【讨论】:

    • 还有一个问题......当生成pdf时,右侧还有一些空间,即它只使用了页面的80%空间我如何使用整个页面空间跨度>
    • 检查边距选项。
    • 我这样定义边距............让margins = { top: 40, bottom: 40, left: 40, right:40, width: 522 };
    • pdf.fromHTML( divToPrint, margins.left, margins.top, { 'width': margins.width, 'elementHandlers': { '#bypassme': function(element, renderer){ alert( 'here'); return true; } }; },function(dispose) { pdf.save('Test.pdf'); }, margins);
    • fromHTML 不是 autotable 的一部分
    猜你喜欢
    • 2018-11-11
    • 2017-11-27
    • 2019-01-23
    • 1970-01-01
    • 2021-03-28
    • 2021-12-13
    • 2018-03-13
    • 1970-01-01
    • 2020-12-10
    相关资源
    最近更新 更多