html2canvas.js崩溃脚本

时间:2018-04-09 10:15:02

标签: jquery html2canvas



  angular.forEach(ids, function (value) {
                var bigCanvas = null; var newWidth = 0; var newHeight = 0; var newMargin = 0;
               // var div = document.querySelector("#" + value);
                var bigCanvas = document.createElement('canvas');
                html2canvas($("#" + value)[0], { canvas: bigCanvas }).then(function (canvas) {
                    var ctx = canvas.getContext('2d');
                    ctx.webkitImageSmoothingEnabled = false;
                    ctx.mozImageSmoothingEnabled = false;
                    ctx.imageSmoothingEnabled = false;
                    ctx.scale(2, 2);
                    var imgsrc = canvas.toDataURL({ format: 'png', quality: 0.01 });
                    var imageData = imgsrc.replace('data:image/png;base64,', '');
                    auditService.auditPostPowerPoint(baseUrl + value, imageData)
                                .then(function (response) {
                                    var res = response.data;
                                    count = count + 1;
                                    if (count == 7) {//below method will be call after 'auditGridData' and 'auditChartImage' will save

                                        auditService.getByFilter("api/auditPowerpointDownload", { plantName: $scope.auditInfo.plant, auditorName: $scope.auditInfo.auditor + "," + $scope.auditInfo.coAuditor })
                                        .then(function (response) {
                                            auditService.download("api/auditPowerPointResultdownload");
                                            $scope.spinnerVisible = false;
                                        });
                                    }
                                }, function (error) {

                                });
                }).catch(function (error) {
                    var err = error;
                    console.log("errror", err);
                });
                
            });

 <script src="~/Content/App/scripts/commonJS/html2canvas.min.js"></script>  
&#13;
&#13;
&#13;

以下是我的代码无法使用Internet Explorer 9+。我使用promise js完成了实现部分,以支持Internet Explorer中的承诺

步骤1: enter image description here

步骤2: enter image description here

Internet Explorer中的

错误: enter image description here

0 个答案:

没有答案