How to open internal pdf url in app


#1

can any one tell me how to open internal pdf in ionic app…

I try this way but not work

<ion-content class="aboutView" lazy-scroll>
<iframe ng-src="pdf/en.pdf" style="width:100%; height: 1100px;"></iframe>
</ion-content>

and controller

myApp.controller('en', function($scope , $http  , $stateParams , $sce ,  $ionicLoading , $ionicSlideBoxDelegate , $ionicScrollDelegate , $timeout , $ionicModal , $compile) {



$ionicLoading.show({ template: 'Loading...' })
var cid = 'http://www.tafseer.info/downloads/New%20directory/English_.pdf';
//console.log(cid);
var incsalespurl='http://tmcs.no-ip.info:83/iAutoCount/AutoCountReport.svc/json/GetSalesDocument?dbName=5bvq9pq8EokHTf+uB/yLD61bh48juTfB/Up19EK4bks=&uDId=d2CISC2oLtdTBGx1gji36fEKYt26vjLyY7h0ngIxj5QfkdjTQBXJRrgjHJCB0WtM&docType=SO&docKey='+cid
$http.get(incsalespurl,{cache:true}).success(function(data){
$scope.salesrow = data.GetSalesDocumentResult;
$scope.pdfurl=$sce.trustAsResourceUrl("http://docs.google.com/gview?embedded=true&url=http://tmcs.no-ip.info:83" + $scope.salesrow.Path + ".pdf");

			$ionicLoading.hide()		
		});
});

#2

You can use inappbrowser, it works with pdf. Here you hace a good example How to open local PDF files from ng-click for an android app?


#3

thank you to help me :slight_smile: