What I've done:
- used by inappbrowser
- google document used
- used web browsing
so I tried all of these methods to show the pdf file on an Android device using ionic. But not to use, I can see the download button in all of these methods. Can someone tell me how I can display PDF without the download option for the user.
my code is:
<div class="col col-50 clsGrid" ng-click="showFile('http://www.orimi.com/pdf-test.pdf')"> </div>
my pdf file is:
http://www.orimi.com/pdf-test.pdf
My JS:
$scope.showModal = function(templateUrl) { $ionicModal.fromTemplateUrl(templateUrl, { scope: $scope, animation: 'slide-in-up' }).then(function(modal) { $ionicLoading.show({ duration: 1000 }); $scope.modal = modal; $scope.modal.show(); }); } // Close the modal $scope.closeModal = function() { $scope.modal.hide(); $scope.modal.remove() }; $scope.showFile = function(FileUrl) { var file = FileUrl; console.log(file); //var openurl = cordova.InAppBrowser.open(file, '_blank'); // var openurl = cordova.InAppBrowser.open(file,'_blank', 'location=yes'); // var openurl = cordova.InAppBrowser.open("https://docs.google.com/viewer?url=" + file, '_blank'); // var openurl = cordova.InAppBrowser.open('https://docs.google.com/viewer?url=http://www.orimi.com/pdf-test.pdf&embedded=true', '_blank'); //window.open("https://docs.google.com/viewer?url=http://www.orimi.com/pdf-test.pdf&embedded=true",'_blank'); var openurl = cordova.InAppBrowser.open('https://docs.google.com/viewer?url=http://www.orimi.com/pdf-test.pdf&embedded=true&toolbar=0&navpanes=0&scrollbar=0', '_blank'); }
I have tried all the ways. But unable to find a solution. If anyone knows this will be helpful. If any specialist in this, I can send my demo project for reference. Thanks in advance!
html angularjs pdf ionic-framework hybrid-mobile-app
hybrid dev
source share