How to use the pdfjs-dist.PDFJS.getDocument function in pdfjs-dist

To help you get started, we’ve selected a few pdfjs-dist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RaoOfPhysics / huomata / index.js View on Github external
//pdfLinkService = new PDFLinkService();

console.log("viewer", PDFViewer);
pdfViewer = new PDFJS.PDFViewer({
  container: container,
  //linkService: pdfLinkService,
});
//pdfLinkService.setViewer(pdfViewer);

container.addEventListener('pagesinit', function () {
  // We can use pdfViewer now, e.g. let's change default scale.
  pdfViewer.currentScaleValue = 'page-width';
});

// Loading document.
PDFJS.getDocument(data).then(function (pdfDocument) {
  // Document loaded, specifying document for the viewer and
  // the (optional) linkService.
  pdfViewer.setDocument(pdfDocument);

  //pdfLinkService.setDocument(pdfDocument, null);
});
github sitepoint-editors / aurelia-pdfjs / src / resources / elements / pdf-document.js View on Github external
.then((pdf) => {
        if (pdf) {
          pdf.destroy();
        }
        return PDFJS.getDocument({ url: newValue, worker: this.worker });
      })
      .then((pdf) => {