![](/img/trans.png)
[英]Decode HTML Entity in Kendo Editor without losing styles and colors
[英]export html and google charts to pfd without losing styles css
您好,我一直在尋找如何導出包含樣式表和一些goocharts圖像格式的html的表格,我可以用jsPDF進行處理,但是我意識到該庫中的表格不接受css樣式,而且如果文本很長,它們也會離開細胞而迷路
我嘗試了jspdf dompdf html2pfd
function reporGeneralPDF() {var pdf = new jsPDF('p', 'pt', 'a4');
source = $('#pdf')[0];
specialElementHandlers = {
'#bypassme': function (element, renderer) {
return true
}
};
margins = {
top: 80,
bottom: 60,
left: 40,
right: 30,
width: 500
};
pdf.fromHTML(
source,
margins.left, // x coord
margins.top, { // y coord
'width': margins.width,
'elementHandlers': specialElementHandlers
},
function (dispose) {
pdf.save('Reporte.pdf');
}, margins
);
}
如果有人知道某種方法,庫或至少一種方法來解決jspd中表的問題,我將不勝感激,因為這將對我有很大幫助
好人,我發現挑戰的解決方案是,即使我沒有用樣式實現它也是一個很好的解決方案,因為它提供了很好的演示文稿,我希望它能為我和我的人服務
function generatePdf() {
var printContents = document.getElementById('pdf').innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.