我正在使用jspdf.debug.js从网站导出不同的数据,但是有几个问题,我无法在导出的PDF中呈现CSS,如果页面中有图像,则导出的PDF会返回空白...
是否有人知道解决方法?
这里有一个jsfiddle演示显示它没有呈现CSS
这是我的脚本
$(document).ready(function() {
$('#export').click(function(){
var d = new Date().toISOString().slice(0, 19).replace(/-/g, ""),
filename = 'financiar_' + d + '.pdf',
pdf = new jsPDF('p', 'pt', 'letter'),
specialElementHandlers = {
'#editor': function( element, renderer ) {
return true;
}
};
pdf.fromHTML(
$('.export').get(0) // HTML element
, 25 // x coord
, 25 // y coord
, {
'width': 550 // was 7.5, max width of content on PDF
, elementHandlers: specialElementHandlers
}
);
pdf.save( filename );
})
});