首页 > 作文

HTML5在线预览PDF的示例代码

更新时间:2023-04-06 11:35:02 阅读: 评论:0

简介

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-purpo, web standards-bad platform for parsing and r差之毫厘谬以千里endering pdfs.

开源地址:

下载后不能直接使用,需要重新构建,不熟悉将会非常麻烦

构建好的程序包:

示例

引用文件,直接复制下文可以直接使用

<!doctype html><html><head>    <meta http-equiv="content-type" content="text/html; chart=utf-8">    <title>课程详情</title>    <style type="text/c潇洒的诗句ss">    </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 () {         放假通知范文   retplayersize();         });        $(window).resize(function () {            retplayersize();        });        function retplayersize() {            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%;">&l虎皮兰的风水作用t;/iframe>');    </script></body></html>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持www.887551.com。

本文发布于:2023-04-06 11:35:01,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/9a5666180ad102667cc7627649af7810.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:HTML5在线预览PDF的示例代码.doc

本文 PDF 下载地址:HTML5在线预览PDF的示例代码.pdf

标签:将会   虎皮   可以直接   下文
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图