Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
//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);
});
.then((pdf) => {
if (pdf) {
pdf.destroy();
}
return PDFJS.getDocument({ url: newValue, worker: this.worker });
})
.then((pdf) => {