好研网
文件 > 海南省教育厅关于召...    |   分享    |       |   





评论 已有

" } }; var options = { maxWidth: 624 }; var markup = $(this).clone(); markup.each(function() { var self = $(this); if (self.is(':hidden')) self.remove(); }); var images = Array(); var img = markup.find('img'); for (var i = 0; i < img.length; i++) { var w = Math.min(img[i].width, options.maxWidth); var h = img[i].height * (w / img[i].width); var canvas = document.createElement("CANVAS"); canvas.width = w; canvas.height = h; var context = canvas.getContext('2d'); context.drawImage(img[i], 0, 0, w, h); var uri = canvas.toDataURL("image/png"); $(img[i]).attr("src", img[i].src); img[i].width = w; img[i].height = h; images[i] = { type: uri.substring(uri.indexOf(":") + 1, uri.indexOf(";")), encoding: uri.substring(uri.indexOf(";") + 1, uri.indexOf(",")), location: $(img[i]).attr("src"), data: uri.substring(uri.indexOf(",") + 1) }; } var mhtmlBottom = "\n"; for (var i = 0; i < images.length; i++) { mhtmlBottom += "--NEXT.ITEM-BOUNDARY\n"; mhtmlBottom += "Content-Location: " + images[i].location + "\n"; mhtmlBottom += "Content-Type: " + images[i].type + "\n"; mhtmlBottom += "Content-Transfer-Encoding: " + images[i].encoding + "\n\n"; mhtmlBottom += images[i].data + "\n\n"; } mhtmlBottom += "--NEXT.ITEM-BOUNDARY--"; var styles = ""; var fileContent = static.mhtml.top.replace("_html_", static.mhtml.head.replace("_styles_", styles) + static.mhtml.body.replace("_body_", markup.html())) + mhtmlBottom; var blob = new Blob([fileContent], { type: "application/msword;charset=utf-8" }); saveAs(blob, fileName + ".doc"); }; })(jQuery); } else { if (typeof jQuery === "undefined") { console.error("jQuery Word Export: missing dependency (jQuery)"); } if (typeof saveAs === "undefined") { console.error("jQuery Word Export: missing dependency (FileSaver.js)"); } } 江油市| 定日县| 额尔古纳市| 涿州市| 惠东县| 合水县| 报价| 南充市| 铅山县| 静海县| 岱山县| 古交市| 张家川| 体育| 河津市| 开平市| 庆安县| 池州市| 苍山县| 巴彦县| 高密市| 湖北省| 太仆寺旗| 亚东县| 松江区| 海门市| 开原市| 黄大仙区| 青龙| 长垣县| 博白县| 新泰市| 伊宁市| 随州市| 雷波县| 枣强县| 方山县| 恭城| 谷城县| 连江县| 临泉县| http://www.7r5077.cn http://www.ylptrq.cn http://www.wrpcnt.cn http://www.kqgbwb.cn http://www.nentuan.cn http://www.t5p8.cn