Article Introduction: in web development we often need to do the need to browse the PDF content online, embed dynamic PDF online, the traditional solution to install the client PDF Reader, if it is in Google can be viewed online, because he himself brought some plug-ins |
In web development, we often need to do online browsing PDF content, online embedded dynamic PDF, the traditional solution to install the client PDF Reader, if it is in Google can be browsed online, because he brought some plug-ins, the previous encounter such a problem is often time-consuming and laborious, very difficult to solve,
Today to share a series of use JavaScript implementation of the PDF plug-in effect, without the help of Third-party Plug-ins can be achieved online browsing function, very practical,
Pdfobject
Pdfobject can help you embed PDF files directly on the page, and sometimes some projects need to embed PDF files dynamically. Pdfobject Designed for this purpose, he was able to embed PDF files quickly and easily, pdfobject use JavaScript to produce the same standard <OBJECT> tags, and then insert <OBJECT> To the selection of your HTML element. You can fill the entire browser window or convert the PDF format to a <DIV> or other block-level element.
Pdf.js
Unlike the closed-source PDF browsing Plug-ins used by Google Chrome from Foxit, Pdf.js is an Open-source product based on open HTML5 and JavaScript technology .
Pdf.js is a small plug-in that is primarily used for online reading of PDF documents on the HTML5 platform and is written based on JavaScript technology without any local technical support.
The Pdf.js was released by Mozilla Labs. Their goal is to create a generic, standards-based network platform that can parse and render PDF files, and eventually release a PDF reader extension, and there is no doubt that Pdf.js will be integrated into Firefox's embedded PDF reader, but the specific consolidation schedule has not yet been determined
Jspdf
Jspdf is an open source library that generates PDFs using the JavaScript language. You can use it in Firefox plug-ins, server-side scripts, or browser scripts. The client Safari and IPhone Safari support the best, followed by opera and Windows Firefox 3, and so on. IE temporarily does not support.
JQuery Media Plugin
jquery Media plugin is a jquery based Web Media Player plug-in that supports most network multimedia players and multimedia formats, such as: Flash, Windows Media Player, Real player, Quicktime, Mp3,silverlight, PDF. It automatically replaces a tag with a DIV based on the current script configuration and generates object, embed, or even an IFRAME code, as to whether an object or Embed,jquery media will be automatically judged by the current platform. So the compatibility aspect is excellent. The following code is the result of jquery media generation:
<div class= "Media" >
<object width= "450" height= "attr1=" attrValue1 "attr2="
Codebase= "Http://www.apple.com/qtactivex/qtplugin.cab"
Classid= "clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" >
<param name= "src" value= "Mybettermovie.mov" >
<param name= "AutoPlay" value= "true" >
<param name= "param1" value= "paramValue1" >
<param name= "param2" value= "ParamValue2" >
<embed width= "450" height= "src=" Mybettermovie.mov "true"
attr1= "attrValue1" attr2= "attrValue2" param1= "paramValue1" param2= "ParamValue2"
Pluginspage= "http://www.apple.com/quicktime/download/" > </embed>
</object>
</div>
Specific Use method
HTML markup Code
<a class= "Media" href= "Sample.mov" >my Quicktime movie</a>
<a class= "Media" href=http://www.webjx.com/javascript/"sample.swf" >my Flash movie</a>
<a class= "Media" href= "sample.wma" >my Audio file</a>
Initialize script:
1
$ (". Media"). Media ();
Google Docs PDF Viewer
ZOHO Viewer
Anychart: Exporting PDFs using JavaScript
The following illustration can be exported as a static or embedded static image in PNG or JPG format, a chart or a fully interactive feature diagram
JQuery Document Viewer
Document viewer is a jquery plugin that allows you to view multiple file formats directly in a Web page. Document Browser supported file formats: PDF files, text files, code, images, audio, video, etc.