sayanee / angularjs-pdf

:page_facing_up: An AngularJS directive <ng-pdf> to display PDF files with PDFJS
http://sayan.ee/angularjs-pdf/
MIT License
494 stars 248 forks source link

pdf viewer is not loading pdf file in case of all librbaries bundles into one lib.js #205

Closed kalebakula closed 7 years ago

kalebakula commented 7 years ago

Hi In our aplication all the library files gets bundled into one lilb,js where pdf.js and pdf.worker.js also part of bundle

whenever we give valid url to $scope.pdfUrl, it looks for lib.worker.js because of this line return pdfjsFilePath.replace(/.js$/i, '.worker.js'); getting 404 not found since it is not present If i comment this line and return pdfjsFilePath alone it works

Is this the only way to handle or any other configuration available

dennybiasiolli commented 7 years ago

Hi @kalebakula, I think you should put pdf.worker.js in a separate bundle file, take a look at this example of pdf.js: https://github.com/mozilla/pdf.js/tree/master/examples/webpack