Reputation: 5273
Is there any pdf viewer component for to see pdf in my angular app. I am tried angular-pdfjs-viewer but it does not work well. I have only a link to pdf file in server.
Thanks in advance
Upvotes: 1
Views: 609
Reputation: 222582
You can display the pdf using an iframe inside your application, have the url in a $scope
variable as below
$scope.yourURL = "pdfUrl";
Then
<iframe src="{{yourURL | trustAsResourceUrl}}"></iframe>
Also you need to use the above filter.
.filter('trustAsResourceUrl', ['$sce', function($sce) {
return function(val) {
return $sce.trustAsResourceUrl(val);
};
}])
Upvotes: 2