插件说明
插件pdfobject.js官方链接:https://pdfobject.com/
插件引入
a、创建盒子,可以对个盒子example1通过style添加样式
<style>.pdfobject-container { height: 30rem; border: 1rem solid rgba(0,0,0,.1);}</style><div id="example1"></div>
b、引入插件
<script src="js/pdfobject.min.js"></script><script> PDFObject.embed( "/pdf/sample-3pp.pdf", "#example1" );</script>
初始化配置
PDFObject.embed(url [string], target [mixed], options [object])
a、url [string]即为pdf的链接;
b、target [mixed] 指定dom节点;
c、options [object]初始化配置选项
- page(初始化的时候跳转到第几页)
- id(给嵌入元素一个id值)
- width(嵌入元素的宽度)
- height(嵌入元素的高度)
- fallbackLink(回调链接,在浏览器不支持的情况下,给与一段提示文字和文件下载链接)
- pdfOpenParams(允许使用adobe开放参数)
开放接口view:
基本参数: Fit FitH FitH, top FitV FitV, left FitB FitBH FitBH, top FitBV FitBV, left 至此不在一一介绍:请查看文档https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf
- PDFJS_URL(pdf.js的展示页面链接)
- forcePDFJS(是否允许整合pdf.js,true为允许)
参考链接:
1、https://pdfobject.com/
2、pdf官方开放接口: https://www.adobe.com/content...
3、https://blog.csdn.net/badgirl...