简介
PDF.js is a Portable Document Format (PDF) viewer that is built with HTML5.
PDF.js is community-driven and supported by Mozilla Labs. Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs.
开源地址:https://github.com/mozilla/pdf.js
下载后不能直接使用,需要重新构建,不熟悉将会非常麻烦
构建好的程序包:build_jb51.rar
示例
引用文件,直接复制下文可以直接使用
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>课程详情</title> <style type="text/css"> </style> <script src="~/Scripts/jquery-1.10.2.min.js"></script> <script src="~/Scripts/plugins/pdfjs/pdf.js"></script> <script src="~/Scripts/plugins/pdfjs/pdf.worker.js"></script> <script type="text/javascript"> var var_filepath = decodeURIComponent("@filepath");//不能跨域 var var_win_height = $(window).height(); $(document).ready(function () { resetPlayerSize(); }); $(window).resize(function () { resetPlayerSize(); }); function resetPlayerSize() { var_win_height = $(window).height(); $(".tmPlayer").css({ "height": var_win_height + "px" }); } </script> </head> <body style="margin: 0;overflow: hidden"> <div id="tmPlayer" class="tmPlayer" style="height: 557px; width: 100%; height: 100%"></div> <script type="text/javascript"> $('.tmPlayer').html('<iframe frameBorder="0" scrolling="no" src="/Scripts/plugins/pdfjs/generic/web/viewer.html?file=' + var_filepath + '" style="width:100%; height:100%;"></iframe>'); </script> </body> </html>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
今天分享一个CSS3制作的翻牌效果,效果如下图所示,所过把把这个效果应用于相册...
之前,我曾提过一个问题, 网站如何检测到是否开启开发者工具? 问题很火,是5月份...
开始实现之前先上个效果图 tips 1.网络图片需先配置download域名,可通过 wx.get...
通常在写HTML5手机端页面的时候,我们会发现页面所显示元素的比例不正确,那此时...
前沿:文章起源在于,朋友跟树酱说在解决项目兼容IE11浏览器过程中,遇到“眼花...
背景 TKE 发行版(TKE Kubernetes Distro)是由腾讯云 TKE 发布的 K8S 发行版本...
rgba 和IE下filter数值的转换 rgba 透明值 IEfilter值 0.1 19 0.2 33 0.3 4C 0.4...
1、不能少了DOCTYPE,浏览器根据你申明的DOCTYPE决定页面渲染规则,如果不声明,...
使用 Vite + React + Typescript 打造一个前端单页应用模板 最近前端大火的 Vite...
简介: 6月19日,mPaaS 盛邀各位 Coder,莅临成都蚂蚁 C 空间,共同探讨面向未来...