pdf.js can directly browse pdf documents under html, it is an open source pdf document reading and parsing plug-in
pdf.js mainly contains two library files, one pdf.js and one pdf.worker.js, one for API parsing and one for core parsing
Document download address: http://mozilla.github.io/pdf.js/getting_started/
Documentation introduction:
Documentation includes build and web documentation.
For the PDF document to be displayed, it will be displayed in the viewer.html interface:
Find the corresponding DEFAULT_URL in viewer.jsz,
var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf';
Clear the value inside. This is the PDF sample of the source document. What we need is to import our own PDF path and change it to the following code:
var DEFAULT_URL = '';
Import the downloaded document and import the related PDF document.
The front-end jsp page calls the PDF document (note the writing of the path after the file, the relative path):
<a href="pdfjs/web/viewer.html?file=../../static/pdf/fenzhang.pdf">Order interface</a>