- Download the PDF.js Express Web Viewer SDK and unzip the package.
- Copy lib/ folder to a location on your web server.
- Create an HTML page.
- Add the PDF.js Express script to the
<head>
of the HTML page.
<script src="lib/webviewer.min.js"></script>
- Add necessary scripts server methods. In this guide, we are going to include Firebase library and a separate file named
server.js
<script src="https://www.gstatic.com/firebasejs/3.5.3/firebase.js"></script>
<script src="server.js"></script>
- Add a script to initiate and use PDF.js Express.
<script src="main.js"></script>
- Create a
<div>
tag in the HTML<body>
and give it an id. This will be the container for the PDF.js Express Web Viewer
<div id="viewer"></div>