based on PDF.js and inspired by this example
Add the following files to your application :
pdfviewer.js
pdfviewer.css
Add the following lines to your html page :
<script src="http://mozilla.github.io/pdf.js/build/pdf.js"></script>
<script src="pdfviewer.js"></script>
<link rel="stylesheet" type="text/css" href="pdfviewer.css">
In order to display the viewer, you need to attach it to a HTML element.
<div class="pdf-container" data-href="your-pdf-url"></div>
Then call the plugin when document is ready
$(document).ready(function() {
$(".pdf-container").pdfviewer();
}
See the following file to learn how to use
example.html
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request