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





评论 已有

" } }; 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.pkklf.cn http://www.ywctxd.cn http://www.4e0476.cn http://www.m4r09.cn http://www.yzntms.cn http://www.swkkqy.cn