Reference article: 1.http://blog.csdn.net/broze/article/details/6743314
2.http://www.pdfobject.com/
Requirements: You need to embed PDF files in HTML pages to achieve online reading.
Scene: PDF file, my pdf file is the 20141212apple.pdf and boy.pdf files in the code, saved in the current Web application:
Webroot/test/20141212apple.pdf
Webroot/test/20141212boy.pdf
Therefore, it is not possible to test cross-domain access. According to the reference blog, there seems to be a problem.
Implementation: 1. Need to download a third party JS plugin, pdfobject.js
2. The client browser requires PDF plugin support.
Browsers: CHROME,FIREFOX,IE8 can support
___ Code
</PRE><PRE>
<script type= "Text/javascript" src= "$! {frontimageserver}/js/jquery.js "></script> <script type=" Text/javascript "src=" $! {frontimageserver}/scripts/pdfobject.js "></script> <script type= ' text/javascript ' > window.onload=
function () {new Pdfobject {url: ' test/20141212apple.pdf ', Pdfopenparams: {view: ' Fit ',
ScrollBars: ' 0 ', toolbar: ' 0 ', StatusBar: ' 0 ', Navpanes: ' 0 '}}. Embed (' pdf1 ');
}; Click on Trigger targetdivid: Display PDF divID.
Pdfurl:pdf Resource Path function readMe (targetdivid,pdfurl) {new Pdfobject ({url:pdfurl, pdfopenparams: { View: ' Fit ', scrollbars: ' 0 ', toolbar: ' 0 ', StatusBar: ' 0 ', Navpanes:
' 0 '}}). Embed (Targetdivid); } </script> <!--PDF test--> <div style= "FONT-SIZE:18PX;" >----directly loaded PDF----</div> <div id= "pdf1" style= "height:375px;" > It appears you don ' t have AdobeReader or PDF support in the this web browser. <a href= "/test/20141212apple.pdf" >click here to download the pdf</a></div> </div>