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