I was in IE11 and Google to do the test, can show, to make a record of things, convenient for everyone to learn!
Tomcat can also be downloaded as a server on the IIS7 server
Tomcat Http://pan.baidu.com/s/1dEEUFQD
Install and configure Tomcat http://jingyan.baidu.com/article/870c6fc33e62bcb03fe4be90.html based on Baidu experience
The introduction of pdf.js at the following URL https://github.com/mozilla/pdf.js
Just download this file here to Http://pan.baidu.com/s/1c2yXWwo
Copy the generic into Tomcat's WebApps.
After you start Tomcat, you can go through:
Http://localhost:8080/generic/web/viewer.html
Call the Pdf.js plug-in and place the plugin in the frame of the page, as shown in the code below
HTML code
1 <!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">2 <HTMLxmlns= "http://www.w3.org/1999/xhtml">3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=gb2312" />5 <title>Pdf</title>6 <Linkrel= "stylesheet"type= "Text/css"href= "Main.css"/>7 </Head>8 <Bodystyle= "Background:url (img/%e8%83%8c%e6%99%af3.jpg)">9 <Center>Ten <DivID= "Head"> One </Div> A <DivID= "Main"> - <DivID= "main_l"> - <iframename= "MyFrame"src= "http://localhost:8080/generic/web/viewer.html"width= "886"Height= "990"></iframe> the </Div> - <DivID= "Main_r"> - <H3><ahref= "Http://localhost:8080/generic/web/viewer.html?file=pdf/1.pdf"Target= "MyFrame">Pdf1</a></H3> - <H3><ahref= "Http://localhost:8080/generic/web/viewer.html?file=pdf/2.pdf"Target= "MyFrame">Pdf2</a></H3> + <H3><ahref= "Http://localhost:8080/generic/web/viewer.html?file=pdf/3.pdf"Target= "MyFrame">Pdf3</a></H3> - </Div> + </Div> A <DivID= "Foot"> at </Div> - </Body> - </HTML>
CSS Code
1 @charset "Utf-8";2 /*CSS Document*/3 #body{background:URL (img/%e8%83%8c%e6%99%af3.jpg)}4 #main{width:1500px;Height:1090px;background:URL (img/%e8%83%8c%e6%99%af3.jpg);Padding-top:0px;}5 #main_r{width:600px;Height:1090px;background:URL (img/%e8%83%8c%e6%99%af3.jpg);float: Left}6 #main_l{width:896px;Height:996px;; float: Left;Padding-top:2px;Padding-left:2px;Padding-bottom:2px;Padding-right:2px;background:#000}7 #head{width:1500px;Height:80px;background:URL (img/%e8%83%8c%e6%99%af3.jpg);}8 #foot{width:1500px;Height:80px;background:URL (img/%e8%83%8c%e6%99%af3.jpg);}
debugging effects such as:
To hide the download feature:
You can change it in viewer.html
Before you change
After the change
That is, add style= "Visibility:hidden", and you can hide the download function.
(The local file that you want to open must be placed in the WebApp path of Tomcat, and if the file name has a Chinese character will not open files, this problem still needs to be resolved!!) )
Use the Pdf.js plugin to solve the problem of online browsing of local PDF files (hide the download function as needed, keep the printing function only)