也许有人可以通过使用html2canvas帮助我保存带有图像的pdf文件这是我的代码
html2canvas(document.images, {
onrendered: function(canvas){
let ctx = canvas.getContext("2d");
ctx.globalAlpha = 0.05;
ctx.fillStyle = "#fff";
let img = canvas.toDataURL('image/jpeg', 1.0);
let doc = new jsPDF();
doc.addImage(img, 'JPEG', 0, 0);
doc.save('Wishes.pdf')
},
})