【发布时间】:2015-12-19 12:14:08
【问题描述】:
我正在尝试下载我根据 jsPDF 的文档完成的 html 标记的简历 pdf 文件。单击时,简历 pdf 实际上正在下载,但 pdf 为空白。
JSfiddle with full code is here;我的 JS 函数如下所示:
$('.btn-download').click(function () {
var doc = new jsPDF();
//var source = $('#target').html();
var specialElementHandlers = {
'.btn-download': function (element, renderer) {
return true;
}
};
doc.fromHTML($('#content').get(0), 0.5, 0.5, {
'width': 150,
'elementHandlers': specialElementHandlers
});
doc.save("resume-cv.pdf");
});
【问题讨论】:
-
任何能帮助我的人都会非常感激。我可以下载 pdf 文件,但没有标记文本。