在 vue.js 中嵌入完整的 Mozilla pdf.js 查看器(通过 vue

编程入门 行业动态 更新时间:2024-10-11 07:28:03
本文介绍了在 vue.js 中嵌入完整的 Mozilla pdf.js 查看器(通过 vue-cli 使用 webpack)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我想嵌入 完整的 Mozilla pdf.js 查看器 在 Vue SPA 中.

I would like to embed the full Mozilla pdf.js viewer in a Vue SPA.

这个 SO 问题 有一个可接受的答案,但我无法使其工作.我也收到了 Uncaught SyntaxError: Unexpected token < 错误,就像评论中的某个人一样.

This SO question has an accepted answer but I cannot make it work. I also get the Uncaught SyntaxError: Unexpected token < error like someone in the comments.

我还发现了一些 npm 包,它们似乎具有相同的用途,但我也无法使它们工作:

I also found a few npm packages that seem to serve the same purpose but I couldn't make them work either:

pdf.js-viewerpdfjs-dist-viewer-min

任何帮助将不胜感激!

推荐答案

我遇到了同样的错误并修复了它.你会试试下面吗?

I had same error and fixed it. would you try bellow?

・固定工人的路径

・残疾工人

window.PDFJS.workerSrc = require('pdf.js-viewer/pdf.worker');
window.PDFJS.disableWorker = true;

这篇关于在 vue.js 中嵌入完整的 Mozilla pdf.js 查看器(通过 vue-cli 使用 webpack)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 01:51:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1146374.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:查看器   完整   js   vue   Mozilla

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!