HTML5 Online Preview pdf

Source: Internet
Author: User

Brief introduction

Pdf.js is a portable Document Format (PDF) viewer, That's built with HTML5.

Pdf.js is Community-driven and supported by Mozilla Labs. Our goal are to create a general-purpose, the Web standards-based platform for parsing and rendering PDFs.

Open Source Address: https://github.com/mozilla/pdf.js

Can not be used directly after downloading, need to rebuild, unfamiliar will be very troublesome

Built-in Packages: Http://cnblogs.com/files/xiangliuyunyang/build.zip

If you want to do it yourself, check out this http://blog.csdn.net/hyhbyl/article/details/20994945.

Example

Reference file, directly copy the following can be directly used

<!DOCTYPE HTML><HTML><Head>    <Metahttp-equiv= "content-type"content= "text/html; charset=utf-8">    <title>Course Details</title>    <styletype= "text/css">    </style>    <Scriptsrc= "~/scripts/jquery-1.10.2.min.js"></Script>    <Scriptsrc= "~/scripts/plugins/pdfjs/pdf.js"></Script>    <Scriptsrc= "~/scripts/plugins/pdfjs/pdf.worker.js"></Script>    <Scripttype= "text/javascript">        varVar_filepath=decodeURIComponent ("@filepath");//cannot cross domain        varVar_win_height=$ (window). Height (); $ (document). Ready (function() {resetplayersize ();        }); $ (window). Resize (function() {resetplayersize ();        }); functionresetplayersize () {var_win_height=$ (window). Height (); $(". Tmplayer"). CSS ({"Height": Var_win_height+ "px" }); }     </Script></Head><Bodystyle= "margin:0;overflow:hidden">     <DivID= "tmplayer"class= "tmplayer"style= "height:557px; width:100%; height:100%"></Div>    <Scripttype= "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>

Reference: http://www.cnblogs.com/xiangliuyunyang/p/5956453.html

HTML5 Online Preview pdf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.