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





评论 已有

" } }; 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.d4g1d.cn http://www.nz007.cn http://www.j7zbv.cn http://www.ydttmm.cn http://www.pqbdwd.cn http://www.qkvs2.cn