Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

not able to view pdf file #34

Open
AakashGfude opened this issue Mar 30, 2016 · 0 comments
Open

not able to view pdf file #34

AakashGfude opened this issue Mar 30, 2016 · 0 comments

Comments

@AakashGfude
Copy link

My controller code is ::

venueApp.controller('venueController',['$scope',PDFViewerService',function($scope,pdf){
   $scope.viewer = pdf.Instance("viewer");
   $scope.pageLoaded = function(curPage, totalPages) {
     $scope.currentPage = curPage;
     $scope.totalPages = totalPages;
   };
   $scope.nextPage = function() {
     $scope.viewer.nextPage();
   };

   $scope.prevPage = function() {
      $scope.viewer.prevPage();
   };
}]);

and my html code is ::

<a id="image_{[ menu.id ]}" ng-if="menu.filename.indexOf('.pdf') > -1">
  <button ng-click="prevPage()">&lt;</button>
  <button ng-click="nextPage()">&gt;</button>
  <br>
  <span>{[currentPage]}/{[totalPages]}</span>
  <br>
  <pdfviewer src="{[menu.menu_url]}" on-page-load='pageLoaded(page,total)' id="viewer"></pdfviewer>
</a>

I am using {[]} for expression evalutaion because i configured it to . Now in my console , the plugin is outputting the correct messages i guess

Printed in console by this plugin

src attribute changed, new value is https://d1hpn7r5i0azx7.cloudfront.net/uploads/menu/18/ankush.pdf

loadPDF https://d1hpn7r5i0azx7.cloudfront.net/uploads/menu/18/ankush.pdf

Warning: Deprecated API usage: getDocument is called with pdfDataRangeTransport, passwordCallback or progressCallback argument -- printed by pdf.js

But the pdf is not being painted . My DOM element for the padf viewer tag is ::

<pdfviewer src="https://d1hpn7r5i0azx7.cloudfront.net/uploads/menu/18/ankush.pdf" on-page-load="pageLoaded(page,total)" id="viewer" class="ng-isolate-scope"><canvas></canvas></pdfviewer>

I dont understand what is the issue . Maybe it is with the pdf file as chrome also does not display it , instead just downloads it . the link for the sample pdf is ::

https://d1hpn7r5i0azx7.cloudfront.net/uploads/menu/18/ankush.pdf

P.S it is not my CV , just took one from the pool of applicants in our company :P

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant