html2canvas jspdf at internetexplorer 11

0

I have the following problem. I have a button that has to make a screenshot and generate a pdf. I use the html2canvas libraries (to make the screenshot) and the jsPDF library, to convert the image to pdf. In browsers chrome and firefox works without problems, but does not work in Internet explorer 11. Any ideas? Pollyfill, promises, e6-promise.js?

 screenshot:function(){


     var doc = new jsPDF('landscape', 'mm','a4');
     html2canvas($("#TexturedClass"), {
         onrendered: function(canvas){
             var imgData = canvas.toDataURL();
             var width = doc.internal.pageSize.width;    
             var height = doc.internal.pageSize.height;
             doc.addImage(imgData,'PNG',0,0,width,height);      
         }
     }).then(function(){
         html2canvas($("#tableSemiFinished"),{
             onrendered: function(canvas){
                 doc.addPage();
                 var imgData = canvas.toDataURL();
                 var width = doc.internal.pageSize.width;    
                 var height = doc.internal.pageSize.height;
                 doc.addImage(imgData,'PNG',0,0,width,0);
                 doc.save('TexturedReport.pdf')    ;
             }
         })                       
      })
    
asked by miss Robot 06.04.2018 в 13:46
source

0 answers