How to use it: 1. Load the necessary jQuery and pdf.js libraries from a CDN. 2. Download and load the jQuery.pdfviewer plugin's files. 3. Create an empty container to hold your PDF viewer.
4. Initialize the plugin and specify the path to the PDF file. $('#pdfviewer').pdfViewer('file.pdf'); 5. Set the size of the PDF viewer. $('#pdfviewer').pdfViewer('file.pdf',{ width: 900, height: 600, }); 6. The filename option allows saving the PDF with a custom name on download. The example uses date values to create a unique name. $('#pdfviewer').pdfViewer('file.pdf',{ filename:"DOCUMENT_" + date.getDay() +'_' + date.getMonth() +'_' + date.getFullYear(), }); 7. The isBase64 flag indicates if the document Url contains a base64 encoded PDF data. Set to true for base64 files. view source $('#pdfviewer').pdfViewer('file.pdf',{ isBase64:true, });