This repository was archived by the owner on Oct 10, 2019. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork85
AngularJS PDF viewer directive using pdf.js.
License
NotificationsYou must be signed in to change notification settings
akrennmair/ng-pdfviewer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
*** WARNING *** Since I keep getting support requests for this: I haven't maintained ng-pdfviewer for ages, and I do not plan to do any further work on it. DO NOT USE THIS IN PRODUCTION!!!
AngularJS PDF viewer directive using pdf.js.
<buttonng-click="prevPage()"><</button><buttonng-click="nextPage()">></button><br><span>{{currentPage}}/{{totalPages}}</span><br><pdfviewersrc="test.pdf"on-page-load='pageLoaded(page,total)'id="viewer"></pdfviewer>
and in your AngularJS code:
varapp=angular.module('testApp',['ngPDFViewer']);app.controller('TestCtrl',['$scope','PDFViewerService',function($scope,pdf){$scope.viewer=pdf.Instance("viewer");$scope.nextPage=function(){$scope.viewer.nextPage();};$scope.prevPage=function(){$scope.viewer.prevPage();};$scope.pageLoaded=function(curPage,totalPages){$scope.currentPage=curPage;$scope.totalPages=totalPages;};}]);
- AngularJS (http://angularjs.org/)
- PDF.js (http://mozilla.github.io/pdf.js/)
Includeng-pdfviewer.js
as JavaScript file, along withpdf.js
andpdf.compat.js
.
DeclarengPDFViewer
as dependency to your module.
You can now use thepdfviewer
tag in your HTML source.
MIT. See LICENSE.md for further details.
Andreas Krennmairak@synflood.at
About
AngularJS PDF viewer directive using pdf.js.
Resources
License
Stars
Watchers
Forks
Packages0
No packages published