A modal component to display PDF files from a url on your website.
-
npm:
npm i pdf-report-modal
-
script tag:
<script src="/dist/js/pdf-report-modal.js"></script>
-
HTML
<div id="myContainer"></div>
-
CSS
<link rel="stylesheet" href="/dist/css/pdf-report-modal.css"/>
-
Assets
Copy files from pdf-report-modal/dist/assets to your-project/dist/assets folder.
-
JavaScript
const options = { modal: { modalTitle: "Some Title" }, document: { documentUrl: "https://mydomain.com/some-file.pdf", pdfWorkerPath: "/dist/js/pdf.worker.min.js" } }; const myViewer = new PdfReportModal("myContainer", options); myViewer.openModal(); myViewer.renderDocument();