- 首先試用的範圍
- 有個服務器部署程序
- 返回的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);
}