How to generate an image from the html2canvas from a view using angularjs

0

I need to generate an image of the page to insert it into a pdf file that I'm generating from the jspdf library, however the results I found are not working, or generate a pdf without css or generate only part of the page.

JS

$scope.gerarPDF = function gerarPDF(){    
    var myPic;
    html2canvas(document.getElementById("pdf"), {
        onrendered: function(canvas) {
            myPic = canvas.toDataUrl("image/jpeg");
            console.log(myPic);
        }
    });   
}

HTML

<div id="pdf" class="col-md-12 col-xs-12 padding10" style="background-color: white" ng-controller="ctrRelatorioBolsaPorOrientadorPdf"></div>

Canvas appears to be initializing but does not finish

    
asked by anonymous 09.04.2018 / 13:56

0 answers