PDF.js is a PDF reader based on HTML5. It is compatible with most mainstream browsers and is relatively simple to use. The steps are as follows:
1. Download the PDF.js plug-inDownload address: http://mozilla.github.io/pdf.js/getting_started/#download
2. File deploymentCreate a new folder and put the PDF.js plug-in file into the new folder.
3. Create new index.htmlThe code in the HTML file is as follows:
<!DOCTYPE html><html> <head> <meta charset=utf-8> <meta name=viewport content=width=device-width, initial-scale=1, maximum-scale=1> <meta name=google content =notranslate> <meta http-equiv=X-UA-Compatible content=IE=edge> <title>"Usage Guide"-Lemon Courseware</title> <script> function openFile () { var url = pdf.pdf; window.open(pdfjs/web/viewer.html?file= + url); } </script> </head> <body> <input type=button onclick=openFile() value=Open > </body></html>4. Place the pdf.pdf file under pdfjs/web/ 5. Click to browse.
Note: Because pdf.js needs to rely on http, https protocols. So browse the index directly to open the error. Just use a service or browse through idea.
The above is the entire content of this article. I hope it will be helpful to everyone’s study. I also hope everyone will support VeVb Wulin Network.