Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
findController: this.pdfFindController,
enhanceTextSelection: true,
textLayerMode: 2
});
// FIXME: the scale is important here too...
//
pdfLinkService.setViewer(pdfElement);
//
// // Loading document.
// const url = '../../../docs/examples/pdf/bigtable.pdf';
const url = '../../../test.pdf';
pdfjsLib.GlobalWorkerOptions.workerSrc = '../../../node_modules/pdfjs-dist/build/pdf.worker.js';
const loadingTask = pdfjsLib.getDocument({
url,
cMapUrl: '../../../node_modules/pdfjs-dist/cmaps/',
cMapPacked: true,
pdfFindController: this.pdfFindController,
});
//
const pdfDocument = await loadingTask.promise;
pdfElement.setDocument(pdfDocument);
pdfLinkService.setDocument(pdfDocument, null);
pdfFindController.setDocument(pdfDocument);
}
$(document).ready(() => {
this.setCursorFocus(200);
pdfjsLib.GlobalWorkerOptions.workerSrc = location.origin + "/assets/pdf.worker.js"
this.loading = this.loadingCtrl.create({
content: 'Please wait...',
duration: 12000
});
this.loading.present();
if (this.utils.isMobile()) {
this.mouseEndEventDeviceSpecific = "touchend"
}
this.init();
document.addEventListener('textAnnotationDropped', this.onTextAnnotationDropped );
});
mounted() {
pdfjsLib.GlobalWorkerOptions.workerSrc = workerSrc;
if (this.hasPDF) this.load();
},
methods: {