how to show pdf file in ionic app with out download

后端 未结 1 1788
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 15:39

Things i did :

  1. used inappbrowser
  2. used google doc
  3. used webview

so i have tried all these methods to show the pdf file in androi

1条回答
  •  余生分开走
    2020-11-30 15:50

    You will need to use ng-pdfviewer.

    AngularJS PDF viewer directive using pdf.js.

    
    
    
    {{currentPage}}/{{totalPages}}

    and in your AngularJS code:

    var app = 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;
        };
    }]);
    

    0 讨论(0)
提交回复
热议问题