改为本地依赖
This commit is contained in:
@@ -10,8 +10,10 @@ import ui8A from "../../assets/ui8A.png";
|
||||
import ui8B from "../../assets/ui8B.png";
|
||||
import testPdf from "../../assets/testPdf.pdf";
|
||||
|
||||
// 设置 PDF.js worker(react-pdf 5.7.2 使用 pdfjs-dist 2.12.313)
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.12.313/pdf.worker.min.js`;
|
||||
// 设置 PDF.js worker - 使用本地文件以支持 Electron 环境
|
||||
// 开发环境:Vite 会从 public 目录提供服务
|
||||
// 生产环境:打包到 dist 目录
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = "/pdf.worker.min.js";
|
||||
|
||||
// 使用本地 PDF 文件进行测试
|
||||
const PDF_URL = testPdf;
|
||||
|
||||
Reference in New Issue
Block a user