HTML2canvas generates Blurry images

前端 未结 8 1471
庸人自扰
庸人自扰 2020-12-01 06:45

I am using jsPDF and it uses html2canvas to generate an image from some html element and insert on the .pdf file. But there is a problem on html2canvas, it generates blurry

8条回答
  •  一生所求
    2020-12-01 07:25

    Try the Canvas2Image library, it gives a better quality image at least for me div to image (fiddle).

        html2canvas($("#widget"), {
            onrendered: function(canvas) {
                theCanvas = canvas;
                Canvas2Image.saveAsPNG(canvas);  // Convert and download as image with a prmompt. 
            }
        });
    

    Good luck!

提交回复
热议问题