PDF.js是1款根据HTML5创建的PDF阅读文章器,适配绝大多数流行的访问器,应用起来,也相对性简易。流程以下:
1.免费下载PDF.js软件
免费下载详细地址:http://mozilla.github.io/pdf.js/getting_started/#download
2.文档布署
建新文档夹,将PDF.js软件文档放入新建的文档夹。
3.新建index.html
在HTML文档编码以下:
<!DOCTYPE html> <html> <head> <meta charset="utf⑻"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="google" content="notranslate"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>《应用指南》-柠檬课件</title> <script> function openFile () { var url = "pdf.pdf"; window.open("pdfjs/web/viewer.html?file=" + url); } </script> </head> <body> <input type="button" onclick="openFile()" value="开启"> </body> </html>
4.将pdf.pdf文档放到pdfjs/web/下
5.点一下访问便可。
留意:由于pdf.js必须依靠http,https协议书。因此立即访问index开启出错。搭个服务,或用idea的访问便可以了。
以上便是本文的所有內容,期待对大伙儿的学习培训有一定的协助,也期待大伙儿多多适用脚本制作之家。