html导出pdf实例,jsPDF导出pdf示例
jsPDF貌似不支持中文
復制代碼 代碼如下:
Downloadifybody {background: #fff; width: 500px; margin: 20px auto;}
input, textarea, p { font-family: 宋體, 黑體; font-size: 12pt;}
input, textarea { border: solid 1px #aaa; padding: 4px; width: 98%;}
window.load=function(){
Downloadify.create('downloadify',{
filename: function(){
return document.getElementById('filename').value;
},
data: function(){
var doc = new jsPDF();
doc.text(20, 20, document.getElementById('data').value);
doc.addPage();
doc.text(20, 20, document.getElementById('data').value);
return doc.output();
},
onComplete: function(){ alert('成功保存文件!'); },
onCancel: function(){ alert('您已經取消保存文件'); },
onError: function(){ alert('出現錯誤了'); },
swf: 'js/downloadify.swf',
downloadImage: 'js/download.png',
width: 100,
height: 30,
transparent: true,
append: false
});
}
it seem do not support to Chinese
You must have Flash 10 installed to download this file.
時間: 2014-05-01
總結
以上是生活随笔為你收集整理的html导出pdf实例,jsPDF导出pdf示例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ValueError: check_ho
- 下一篇: OpenCV_02 图像的基本操作:图像