【发布时间】:2018-12-24 11:23:59
【问题描述】:
我正在尝试将表格导出为 PDF 文件,但如果有希伯来语字符,它将无法正确显示。
我尝试在 HEAD 部分添加 UTF-8 的 mata 标记以及 'Content-Type: text/html; 的 php 标头;字符集=utf-8'
function demoFromHTML() {
var pdf = new jsPDF('p', 'pt', 'letter');
source = $('#customers')[0];
specialElementHandlers = {
// element with id of "bypass" - jQuery style selector
'#bypassme': function (element, renderer) {
// true = "handled elsewhere, bypass text extraction"
return true
}
};
margins = {
top: 80,
bottom: 60,
left: 10,
width: 300
};
pdf.fromHTML(
source, // HTML string or DOM elem ref.
margins.left, // x coord
margins.top, { // y coord
'width': margins.width, // max width of content on PDF
'elementHandlers': specialElementHandlers
},
function (dispose) {
pdf.save('Test.pdf');
}, margins);
}
【问题讨论】:
标签: javascript html