Requirements: JSP page to display the PDF file, below gives two kinds of schemes, JS Plug-ins that kind of good AH
two options: a direct link, the PDF file as an img file, similar to <a href= ""/> This form, such links: The code is as follows: <frame src= "PDF file Address" ></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 see the small number of JS code: Code as follows: <script type= "Text/javascript" > window.onload = Functi On () { var success = new Pdfobject ({URL: "Sample.pdf"}). Embed (); }; </script> OK, so 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. 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.