小编car*_*ush的帖子

JSPDF - 如何删除pdf下载中的空白最后一页

我在这里使用 jspdf。
下载pdf时出现空白页。
当您单击submit1按钮时,图表将生成,当您按下下载按钮时,这些图表将下载为 pdf。
一切正常,但最后一页出现了空白页。
这是我在 plunker 中的现场演示。也在这里我有 html 和 javascript 代码

html

<div><img id="logo" style="width:30%" src="https://www.gstatic.com/webp/gallery3/3.png"/>dddddddd</div>
 <input type="button" id="download"  value="download" /> click to console
  <div><button id="button1" class="button1">submit1</button></div>
  <p id="bottom-content">footer</p>
Run Code Online (Sandbox Code Playgroud)

脚本

$(document).ready(function() {
    var index = 0;
    var id = [];
    $('#button1').on('click', function() {
        $('body').append($("<div id='chart" + index + "'></div>"));

        Highcharts.chart('chart' + index, {
           title: {
        text: 'Chart-'+index+''
    },
            series: [{
                data: [1, 2, 3]
            }]
        });
        var temp = "chart" + index …
Run Code Online (Sandbox Code Playgroud)

html javascript jspdf

3
推荐指数
1
解决办法
6168
查看次数

标签 统计

html ×1

javascript ×1

jspdf ×1