当前位置:首页 > 话题广场 > 攻略专题 > 游戏问答

pdf文件和word文件怎么打开方式?总结很全面速看!浏览器预览word、excel、pdf的方式

1、mammo(word.docx)

Var URL=URL

var xhr=new XMLHttpRequest();

Xhr。open('get ',url,true);

X='水滴';

//添加请求标头

//从cookie获取令牌

X ('access-token ',get cookie(' access-t oken '));

Xhr。onload=function ({

If atus==200){

var blob=;

//读取流

readfileinputeventasarraybuffer(blob);

$('#wordJS ')。show();

}

}

x();

Function displayResult (result) {

//读取的blob格式副本将被分配html值

Let html=result。value

Let newHTML=(//g,'')

.replace('h1 ',' h1 ')

.replace( /table/g,' table ')

.replace(/tr/g,' tr ')

.replace( /td/g,' td ')

.replace(/p/g,' p ');

document . getelementbyid(' word output ')。innerhtml=newhtml

}

function readfileinputeventasarraybuffer(excel blob){

Var reader=new FileReader(:)

Reader.onload=function(加载事件){

var array buffer=load event . target . result;

Try{

请读取//

mamoth . converttohtml({ arraybuffer 3360 arraybuffer })。then (displayresult)。done();

}catch(err) {

Con(“格式不正确!”);

}

reader . reada sarr ay buffer(excel b 1 ob);

}

2、xl(excel.xlsx)

//url文件地址

Var URL=URL

var xhr=new XMLHttpRequest();

X('get ',url,true);

X='水滴';

//添加请求标头

X ('access-token ',get cookie(' access-token '));

X=function () {

If atus==200) {

var blob=;

readfileinputeventasarraybuffer(blob);

}

}

x();

function readfileinputeventasarraybuffer(文件){

const reader=new file reader();

Reader.readasbinarystring(文件);

Reader.onload=(e)={

Constdata=e

constzz excel=window . xlsx . read(data,{ type 3360 ' binary ' });

const result=[];

for(let I=0;I zzexcel。s;I) {

const new data=window . xlsx . u[ZZ excel . sheet names[I]]);

Re(.newData)

}

//储存资料,并将excel读取为阵列

DataExcel=result

}

}3,(嵌入)

!Function(根、工厂){

Function'==typeof define de?Define ([],工厂): ' object '==type of module modul

e.exports ? module.exports = factory() : root.PDFObject = factory() }(this, function() { "use strict"; if ("undefined" == typeof window || void 0 === window.navigator || void 0 === window.naviga || void 0 === window.naviga) return !1; let nav = window.navigator , ua = window.naviga , isIE = "ActiveXObject"in window , isModernBrowser = void 0 !== window.Promise , supportsPdfMimeType = void 0 !== nav.mimeTypes["application/pdf"] , isMobileDevice = void 0 !== nav.platform && "MacIntel" === nav.platform && void 0 !== nav.maxTouchPoints && nav.maxTouchPoints > 1 || /Mobi|Tablet|Android|iPad|iPhone/.test(ua) , isSafariDesktop = !isMobileDevice && void 0 !== nav.vendor && /Apple/.te) && /Safari/.test(ua) , isFirefoxWithPDFJS = !!(!isMobileDevice && /irefox/.test(ua) && ua.split("rv:").length > 1) && parseIn("rv:")[1].split(".")[0], 10) > 18 , createAXO = function(type) { var ax; try { ax = new ActiveXObject(type) } catch (e) { ax = null } return ax } , supportsPDFs = !isMobileDevice && (isModernBrowser || isFirefoxWithPDFJS || supportsPdfMimeType || isIE && !(!createAXO("AcroPDF.PDF") && !createAXO("PDF.PdfCtrl"))) , embedError = function(msg, suppressConsole) { return suppressConsole || con("[PDFObject] " + msg), !1 } , emptyNodeContents = function(node) { for (; node.firstChild; ) node.removeChild) } , generatePDFJSMarkup = function(targetNode, url, pdfOpenFragment, PDFJS_URL, id, title, omitInlineStyles) { emptyNodeContents(targetNode); let fullURL = PDFJS_URL + "?file=" + encodeURIComponent(url) + pdfOpenFragment , div = document.createElement("div") , iframe = document.createElement("iframe"); return i = fullURL, i = "pdfobject", i = "application/pdf", i = "0", i = "fullscreen", i = title, id && = id), omitInlineStyles || = "position: absolute; top: 0; right: 0; bottom: 0; left: 0;", i = "border: none; width: 100%; height: 100%;", = "relative", = "auto"), div.appendChild(iframe), (div), ("pdfobject-container"), ("iframe")[0] } , embed = function(url, targetSelector, options) { let selector = targetSelector || !1 , opt = options || {} , id = "string" == typeof o ? o : "" , page = o || !1 , pdfOpenParams = o || {} , fallbackLink = o || !0 , width = o || "100%" , height = o || "100%" , title = o || "Embedded PDF" , assumptionMode = "boolean" != typeof o || o , forcePDFJS = "boolean" == typeof o && o , supportRedirect = "boolean" == typeof o && o , omitInlineStyles = "boolean" == typeof o && o , suppressConsole = "boolean" == typeof o && o , forceIframe = "boolean" == typeof o && o , PDFJS_URL = o || !1 , targetNode = function(targetSelector) { let targetNode = document.body; return "string" == typeof targetSelector ? targetNode = document.querySelector(targetSelector) : void 0 !== window.jQuery && targetSelector instanceof jQuery && ? targetNode = (0) : void 0 !== && 1 === && (targetNode = targetSelector), targetNode }(selector) , fallbackHTML = "" , pdfOpenFragment = ""; if ("string" != typeof url) return embedError("URL is not valid", suppressConsole); if (!targetNode) return embedError("Target element cannot be determined", suppressConsole); if (page && = page), pdfOpenFragment = function(pdfParams) { let prop, string = ""; if (pdfParams) { for (prop in pdfParams) (prop) && (string += encodeURIComponent(prop) + "=" + encodeURIComponent(pdfParams[prop]) + "&"); string && (string = (string = "#" + string).slice(0, - 1)) } return string }(pdfOpenParams), forcePDFJS && PDFJS_URL) return generatePDFJSMarkup(targetNode, url, pdfOpenFragment, PDFJS_URL, id, title, omitInlineStyles); if (supportsPDFs || assumptionMode && !isMobileDevice) { return function(embedType, targetNode, targetSelector, url, pdfOpenFragment, width, height, id, title, omitInlineStyles) { emptyNodeContents(targetNode); let embed = document.createElement(embedType); if = url + pdfOpenFragment, embed.className = "pdfobject", embed.type = "application/pdf", embed.title = title, id && = id), "iframe" === embedType && = "fullscreen"), !omitInlineStyles) { let style = "embed" === embedType ? "overflow: auto;" : "border: none;"; targetSelector && targetSelector !== document.body ? style += "width: " + width + "; height: " + height + ";" : style += "position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;", embed. = style } return ("pdfobject-container"), (embed), (embedType)[0] }(forceIframe || supportRedirect || isSafariDesktop ? "iframe" : "embed", targetNode, targetSelector, url, pdfOpenFragment, width, height, id, title, omitInlineStyles) } return PDFJS_URL ? generatePDFJSMarkup(targetNode, url, pdfOpenFragment, PDFJS_URL, id, title, omitInlineStyles) : (fallbackLink && (fallbackHTML = "string" == typeof fallbackLink ? fallbackLink : "<p>This browser does not support inline PDFs. Please download the PDF to view it: <a href='[url]'>Download PDF</a></p>", = (/\[url\]/g, url)), embedError("This browser does not support embedded PDFs", suppressConsole)) }; return { embed: function(a, b, c) { return embed(a, b, c) }, pdfobjectversion: "2.2.7", supportsPDFs: supportsPDFs } } //url为文件路径,id为dom PDFObject.embed(url, id);

1.《pdf文件和word文件怎么打开方式?总结很全面速看!浏览器预览word、excel、pdf的方式》援引自互联网,旨在传递更多网络信息知识,仅代表作者本人观点,与本网站无关,侵删请联系页脚下方联系方式。

2.《pdf文件和word文件怎么打开方式?总结很全面速看!浏览器预览word、excel、pdf的方式》仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证。

3.文章转载时请保留本站内容来源地址,https://www.lu-xu.com/gl/3034889.html

上一篇

pdf文件和word文件怎么打开方式?总结很全面速看!如何用Word打开PDF文件?

下一篇

关于ping值高会怎么样,你需要知道这些是谁偷走了你的网速?路由器选购一文就够了

pdf文件和word文件怎么打开方式?总结很全面速看!如何用Word打开PDF文件?

  • pdf文件和word文件怎么打开方式?总结很全面速看!如何用Word打开PDF文件?
  • pdf文件和word文件怎么打开方式?总结很全面速看!如何用Word打开PDF文件?
  • pdf文件和word文件怎么打开方式?总结很全面速看!如何用Word打开PDF文件?
pdf文件和word文件怎么打开方式?总结很全面速看!Word、PDF、PPT、TXT之间的转换方法!白领一族转起

pdf文件和word文件怎么打开方式?总结很全面速看!Word、PDF、PPT、TXT之间的转换方法!白领一族转起

pdf文件和word文件怎么打开方式相关介绍,#知识辞职计划# 如何在Word、PDF、PPT和TXT之间转换!白领一族转身! 一、如何将PPT转换为WORD格式。 1.利用概览视图 打开PPT演示文稿,单击“概述”,然后在左侧幻灯片/概述任务窗...

pdf文件和word文件怎么打开方式?我来告诉你答案电脑上PDF文件怎么打开?打开PDF文件的办法总结

  • pdf文件和word文件怎么打开方式?我来告诉你答案电脑上PDF文件怎么打开?打开PDF文件的办法总结
  • pdf文件和word文件怎么打开方式?我来告诉你答案电脑上PDF文件怎么打开?打开PDF文件的办法总结
  • pdf文件和word文件怎么打开方式?我来告诉你答案电脑上PDF文件怎么打开?打开PDF文件的办法总结