0

I have been trying to open pdf on an ionic app using file opener2 Cordova plugin but it's not working and is showing errors with Cordova not defined(but Id id inject the ngCordova module at app.js

    $scope.gotoPDF1 = function () {
      cordova.plugins.fileOpener2.open(
        'pdf/main.pdf',
        'application/pdf', {
          error: function (e) {
            console.log('Error status: ' + e.status + ' - Error message: ' + e.message);
          },
          success: function () {
            console.log('file opened successfully');
          }
        }
      );
    }
        <div class="col col-60" style="margin-left:8%" ng-click="gotoPDF1()">
V5NEXT
  • 1,907
  • 4
  • 19
  • 38

0 Answers0