您可以使用此
https://github.com/akrennmair/ng-pdfviewer和
https://github.com/mozilla/pdf.js.以前,我对该指令进行了一些更改,并完成了此任务.我不会深入,但我为你做了榜样.创建的Plunker,但不知何故不能运行它
https://plnkr.co/edit/xOIYGvTFJ2bU2rawg9Wc?p=preview.这是完整的例子
https://drive.google.com/open?id=0Bzls0-jRP-7GMHFnQWJwUUxRYWs.只需在你的服务器上运行它.
angular.module('ngPDFViewer', []).
directive('pdfviewer', ['$parse', function ($parse) {
var canvas = null;
var instance_id = null;
var excludedPages = [];
return {
restrict : "E",
template : "
scope : {
onPageLoad : '&',
loadProgress : '&',
src : '@',
id : '=',
excludedPages : '='
},
controller : ['$scope', function ($scope) {
$scope.