用的是pdf.js,引用如下
pdfjsLib输出为undefined
版本 "pdfjs-dist": "^2.2.228"
不好意思,自问自答
改用require
const pdfjsLib = require('pdfjs-dist');
pdfjsLib.GlobalWorkerOptions.workerSrc = require('pdfjs-dist/build/pdf.worker.entry');
是突然在一篇博客看到的:
https://blog.csdn.net/xss392795158/article/details/108079627