How to use the PDF.JS plug-in to preview PDF files in HTML
This article mainly introduces "how to use the PDF.JS plug-in to preview PDF files in HTML" related knowledge, editor through the actual case to show you the process of operation, the method of operation is simple and fast, practical, hope that this "how to use the PDF.JS plug-in to preview PDF files in HTML" article can help you solve the problem.
PDF.js is a HTML5-based PDF reader that is compatible with most mainstream browsers and is relatively easy to use. The steps are as follows:
1. Download the PDF.js plug-in
two。 File deployment
Create a new folder and put the PDF.js plug-in files in the new folder.
3. Create a new index.html
The code in the HTML file is as follows:
"usage Guide"-lemon courseware function openFile () {var url = "pdf.pdf"; window.open ("pdfjs/web/viewer.html?file=" + url);}