fix print error
This commit is contained in:
parent
b7680a7b61
commit
eaeab4f1fa
|
@ -33,7 +33,7 @@
|
||||||
html2canvas($('div.print_text')[0]).then(canvas => {
|
html2canvas($('div.print_text')[0]).then(canvas => {
|
||||||
var pdf = new jsPDF('px', 'mm', 'a4');
|
var pdf = new jsPDF('px', 'mm', 'a4');
|
||||||
var width = pdf.internal.pageSize.getWidth()-3;
|
var width = pdf.internal.pageSize.getWidth()-3;
|
||||||
var height = pdf.internal.pageSize.getHeight();
|
var height = $('div.print_text').innerHeight()/$('div.print_text').innerWidth()*width;
|
||||||
pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0,width ,height );
|
pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0,width ,height );
|
||||||
pdf.save(filename);
|
pdf.save(filename);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue