Home  >  Article  >  Web Front-end  >  How to display pdf files in jsp

How to display pdf files in jsp

anonymity
anonymityOriginal
2019-05-29 15:49:085483browse

To realize the online preview of pdf, I found a lot of information on the Internet, but it was a bit troublesome to implement. I accidentally found a plug-in that can very conveniently realize the online preview of pdf files.

How to display pdf files in jsp

Plug-in: PDFObject

Download address: https://github.com/pipwerks/PDFObject

Steps:

1. Introduce the plug-in, here you only need pdfobject.js

<script src="/js/pdfobject.js"></script>

2. Create a new div as the pdf display window

<div id="example1"></div>

3. Define the content of the div

<script>PDFObject.embed("/pdf/sample-3pp.pdf", "#example1");</script>

4. Complete

The above is the detailed content of How to display pdf files in jsp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn