Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the PDF.JS plug-in to preview PDF files in HTML

Shulou Source: shulou.com Published: 2022-06-01 18:59:42 10月05日 Update

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);}

Tags: Files plug-ins browsing knowledge folders industries different practical mainstream code user guides content most practical practical guidelines articles methods more lemon Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Information macOS MariaDB Shulou Tech Info