PDF.js 使用方式

使用viewer.html

从Git上下载pdf插件

使用方式

   window.open('域名/static/pdfjs/web/viewer.html?file='+encodeURIComponent('域名'+pdf路径),'PDF');
  
比如:  
  window.open(
'https://mail.chengdu.gov.cn/static/pdfjs/web/viewer.html?file='+encodeURIComponent('https://mail.chengdu.gov.cn/11.pdf'),'PDF');

 

猜你喜欢

转载自www.cnblogs.com/zsy0712/p/11411031.html