服務器上管理系統中使用pdf.js

  1. 首先試用的範圍
  • 有個服務器部署程序
  • 返回的pdf的是帶有ip的url鏈接,如果返回是工作流的情況下,可以直接在項目中使用pdf.js,
  • 返回的圖片鏈接要和pdf.js文件一樣端口,ip,協議一致
    然後在項目中直接加上一個iframe標籤就可以。
    示例代碼:
打開到下面的代碼的文件方法可以這樣寫:
function showImg( url) {
window.localStorage.hxurl= url
	window.open("checkFile.html")
}
	<iframe id="fileIFrame" src="" ></iframe>

js:

window.onload = function() {
		
		var _url=window.localStorage.hxurl;

			document.getElementById("fileIFrame").setAttribute("src", 'http://192.168.1.50/file/web/web/viewer.html?file=' + _url);
		
	}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章