pdfjs在pc端预览:https://www.cnblogs.com/wuqilang/p/13031290.html

当使用pdfjs在移动端预览时显示不出来,pc端调式是可以的,到了手机上 就不行。

 

使用pdfjs:

1、下载:npm install pdfh5

2、使用:

<template>
  <div style="height:100vh;" ref="pdfRef"></div>
</template>
<script>
import Pdfh5 from 'pdfh5'
import 'pdfh5/css/pdfh5.css'
export default {
  mounted() {
    const pdfh5 = new Pdfh5(this.$refs.pdfRef, {
      pdfurl:
        'http://filegateway.test.mistong.com/api/filecenter/fileService/file/947631061519778296.pdf'
    })
    // 监听完成事件
    pdfh5.on('complete', function (status, msg, time) {
      console.log(
        `状态:${status},信息:${msg},耗时:${time}毫秒,总页数:${this.totalNum}`
      )
    })
  }
}
</script>

 

相关文章:

  • 2022-02-22
  • 2021-12-09
  • 2021-08-01
  • 2022-12-23
  • 2021-12-16
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-01-22
  • 2021-11-14
  • 2023-02-12
相关资源
相似解决方案