如何解决如何使用 npm 用 pdftron 显示 pdf
-
pdftron/webviewer 已安装
"dependencies": { "@pdftron/webviewer": "^7.3.0","body-parser": "^1.19.0","express": "^4.17.1","mongoose": "^5.9.7","nodemon": "^2.0.2","pug": "^2.0.4" }
-
Webviewer 静态文件已复制到公共文件夹
-
index.html 文件中的 JavaScript 尝试加载 pdf
欢迎使用网络浏览器 从“@/webviewer”导入 WebViewerWebViewer({ path: '/webviewer',initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf' },document.getElementById('viewer')).then(instance => {}) </script>
-
pdf文件不显示,代码有什么问题?
解决方法
感谢您分享存储库链接。
遵循本指南:https://www.pdftron.com/documentation/web/get-started/manually/
请尝试执行以下操作:
-
请将 webviewer.min.js 从 pdftron webviewer 节点模块复制并粘贴到 /public/webviewer
-
在您的 custom.js 中,请删除从 webviewer 导入的行
-
在 index.html 中,请在调用 custom.js 文件之前添加此脚本标记:
g++ main.cpp -I /usr/local/Cellar/sfml/2.5.1_1/include -I /usr/local/Cellar/jsoncpp/1.9.4_1/include -L /usr/local/Cellar/sfml/2.5.1_1/lib -L /usr/local/Cellar/jsoncpp/1.9.4_1/lib -l libsfml-audio.2.5.1.dylib -l libsfml-graphics.2.5.1.dylib -l libsfml-network.2.5.1.dylib -llibsfml-system.2.5.1.dylib -l libsfml-window.2.5.1.dylib -l jsoncpp.24.dylib -o sfml -std=c++11 ld: library not found for -llibsfml-audio.2.5.1.dylib clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [exe] Error 1
编辑: 我注意到当我加载您的应用程序时,网络选项卡上有一个 404,这让我认为库的设置没有正确集成。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。