Two options: a direct link to the PDF file as an img file, similar to the <a href= ""/> This form, such links:
Copy Code code as follows:
<frame src= "Address of PDF file" ></frame>
Another: Use JS plugin ha.
The realization of reading a PDF file of JS Plug-ins a lot, such as: Pdf.js: is a technology prototype is mainly used to display PDF documents on the HTML5 platform, without any local technical support; Jspdf: is an open source library that generates PDFs using JavaScript language (IE is not supported);
More simple and easy to use JS plugin: Pdfobject.js, is a JavaScript library used to dynamically embed PDF documents in HTML.
The effect is as follows:
Pdfobject.js has now been upgraded to 1.2 to support IE9.
Pdfobject.js tenet: Sometimes you need a little JavaScript. When I do, try Pdfobject.
To look at the small number of JS code:
Copy Code code as follows:
<script type= "Text/javascript" >
Window.onload = function () {
var success = new Pdfobject ({URL: "Sample.pdf"}). Embed ();
};
</script>
OK, that's fine. Just write the address right.
What if I load a pdf in a div? Reader net, found that the embed () method can have parameters, no parameter refers to the body, there are parameters are specific to a certain position.
Copy Code code as follows:
<script type= "Text/javascript" >
Window.onload = function () {
var success = new Pdfobject ({URL: "Sample.pdf"}). Embed ("div id");
};
</script>
Of course, you can further set parameters, such as how many seconds you want to preview the speed, there are CSS, no CSS, etc.