"https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FrMUWxHT5PONNOz5eEiYhRP618eW.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FrMUWxHT5PONNOz5eEiYhRP618eW.png)
在vue3中使用vue-pdf-embed,不显示内容 "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240928/60654051af5d252cbd3ac28fa9a58e3d.png) 上一页 下一页 {{ state.pageNum }}/{{ state.numPages }} 放大 缩小 import { reactive, onMounted, computed } from "vue"; import VuePdfEmbed from "vue-pdf-embed"; import { createLoadingTask } from "vue3-pdfjs"; const props = defineProps({ pdfUrl: { type: String, default: "", }, }); const state = reactive({ source: props.pdfUrl, //预览pdf文件地址 // source: require("../../../assets/vue.pdf"), //预览pdf文件地址 pageNum: 1, //当前页面 scale: 1, // 缩放比例 numPages: 0, // 总页数 }); const scale = computed(() => `transform:scale(${state.scale})`); function lastPage() { if (state.pageNum > 1) { state.pageNum -= 1; } } function nextPage() { if (state.pageNum 1) { state.scale -= 0.1; } } onMounted(() => { console.log(state,'state'); const loadingTask = createLoadingTask(state.source); loadingTask.promise.then((pdf) => { state.numPages = pdf.numPages; }); }); .pdf-preview { position: relative; height: 100vh; padding: 20px 0; box-sizing: border-box; background-color: e9e9e9; } .pdf-wrap { overflow-y: auto; } .vue-pdf-embed { text-align: center; width: 100%; border: 1px solid #e5e5e5; margin: 0 auto; box-sizing: border-box; } .page-tool { position: absolute; bottom: 35px; padding-left: 15px; padding-right: 15px; display: flex; align-items: center; background: rgb(66, 66, 66); color: white; border-radius: 19px; z-index: 100; cursor: pointer; margin-left: 50%; transform: translateX(-50%); } .page-tool-item { padding: 8px 15px; padding-left: 10px; cursor: pointer; } 使用vue3-pdfjs都可以获取到页数,内容却不显示
查看此问题 "https://www.zhihu.com/question/388237379" (https://link.segmentfault.com/?enc=k7e3Cui2qoVxmBI0u2G%2Fpg%3D%3D.f6p8kHivBd7XHcqdigapxaQU2k%2BXhp0ZPyGfYXkrYLgKr0G0E1By6jbNrVljtNI5) 几乎都是广告 请问有类似 draw.io 开源免费好用的 PDF 编辑器吗?
前端怎么预览pdf iframe和一些库 要么完全打不开 白屏 要么只能看第一页 企微自建应用
vue使用pdf怎么监听他的翻页和文字定位的事件? 我在网上找了一些帖子都是利用iframe做的 除了这个方法还有其他办法吗 还有pdf.js和pdf-dist.js不是一个东西吗??? "image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241104/cfec09747235387bd3abab42fed4787b.png) 是这种翻页 不是只渲染一页然后下一页 这个页面就变成了第二页而是整个渲染然后去进行翻页