PDF Viewer Setup Import PDF.js Library To create a PDF viewer, you need to import the PDF.js library. Add the following script tag to your HTML file: <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.min.js"></script>