Pdf viewer for my angular app

583 Views Asked by At

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

1

There are 1 best solutions below

0
Sajeetharan On BEST ANSWER

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