Reputation: 83
I am using pdf.js library in a js page and it works fine. However I want to know if it is possible to change the path of the library using other method instead of:
var url = 'something/helloworld.pdf';
var pdfjsLib = window['pdfjs-dist/build/pdf']; <- How can I change this to a relative/absolute path?
// Asynchronous download of PDF
var loadingTask = pdfjsLib.getDocument(url);
loadingTask.promise.then(function(pdf) {
console.log('PDF loaded');
...
Upvotes: 2
Views: 1024
Reputation: 83
Resolved - https://github.com/mozilla/pdf.js/blob/master/examples/learning/helloworld.html
A wrong variable name was also delaying my effort.
Upvotes: 1