Joao
Joao

Reputation: 83

pdf.js change path of library in example given

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

Answers (1)

Joao
Joao

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

Related Questions