我有以下代码。我得到pdfjsLib为未定义。如果我取消注释需求,它将获取一个pdfjsLib对象,但出现错误,提示版本冲突。
任何帮助都非常感谢! Prem
var pdfjsLib = window['pdfjs-dist/build/pdf'];
//var pdfjsLib = require('pdfjs-dist/build/pdf');
console.log("pdfjsLib")
console.log(pdfjsLib)
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js';
pdfjsLib.disableWorker = true;