How to display pdf files in jsp

anonymity
Release: 2019-05-29 15:49:08
Original
5512 people have browsed it

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>
Copy after login

2. Create a new div as the pdf display window

<div id="example1"></div>
Copy after login

3. Define the content of the div

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

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!

Related labels:
jsp
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template