jspdf检查pdf文件大小
我想用jspdf.js脚本检查pdf文件大小。我需要在下载文件之前在屏幕上显示这个。有什么可能性吗jspdf检查pdf文件大小,pdf,size,jspdf,Pdf,Size,Jspdf,我想用jspdf.js脚本检查pdf文件大小。我需要在下载文件之前在屏幕上显示这个。有什么可能性吗 function demoFromHTML(x = false) { var pdf = new jsPDF('p', 'pt', 'letter'); source = $('#print')[0]; specialElementHandlers = {
function demoFromHTML(x = false) {
var pdf = new jsPDF('p', 'pt', 'letter');
source = $('#print')[0];
specialElementHandlers = {
'#bypassme': function (element, renderer) {
return true
}
};
margins = {
top: 80,
bottom: 60,
left: 40,
width: 522
};
pdf.fromHTML(
source,
margins.left,
margins.top, {
'width': margins.width,
'elementHandlers': specialElementHandlers
},
function (dispose) {
if(x){
pdf.output('dataurlnewwindow');
}else{
pdf.save('<?php the_title() ?>.pdf');
}
}, margins
);
}
函数demoFromHTML(x=false){
var pdf=新的jsPDF(“p”、“pt”、“字母”);
source=$('#print')[0];
SpecialElementHandler={
“#绕过我”:函数(元素、渲染器){
返回真值
}
};
边距={
排名:80,
底数:60,
左:40,,
宽度:522
};
pdf.fromHTML(
来源:,
嗯,左,
margins.top,{
“宽度”:边距.width,
“elementHandlers”:specialElementHandlers
},
功能(处置){
if(x){
输出('dataurlnewwindow');
}否则{
pdf.save('.pdf');
}
},利润率
);
}
我找到了一个解决方案,非常简单。 也许有人会用它:
pdf.output().length代码>我找到了一个解决方案,非常简单。
也许有人会用它:
pdf.output().length代码>