pdf预览----vue-pdf、pdfjs-dist、pdfjs插件

没有get到 vue-pdf、pdfjs-dist 的好,直接使用pdfjs插件。

 

pdfjs使用教程:

  1、官网下载压缩包:http://mozilla.github.io/pdf.js/getting_started/#download(下载稳定版)

    

  2、将下载下来的文件解压缩后,将里面的pdf文件夹拷贝到项目中的public文件夹中

    

  3、访问地址: /pdf/web/viewer.html?file=       scope.row.certificateUrl----是文件的地址

          <div class="show-certificat-img" v-else>
            <a :href="'/pdf/web/viewer.html?file='+scope.row.certificateUrl" target="_blank">{{scope.row.fileName}}</a>
          </div>

   4、效果:功能很全的pdf预览

 

posted @ 2020-06-02 15:02  吴小明-  阅读(9385)  评论(2编辑  收藏  举报