插件pdfobject.js官方連接:https://pdfobject.com/瀏覽器
a、建立盒子,能夠對個盒子example1經過style添加樣式dom
<style> .pdfobject-container { height: 30rem; border: 1rem solid rgba(0,0,0,.1); } </style> <div id="example1"></div>
b、引入插件url
<script src="js/pdfobject.min.js"></script> <script> PDFObject.embed( "/pdf/sample-3pp.pdf", "#example1" ); </script>
PDFObject.embed(url [string], target [mixed], options [object]).net
a、url [string]即爲pdf的連接;
b、target [mixed] 指定dom節點;
c、options [object]初始化配置選項插件
開放接口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
參考連接:
一、https://pdfobject.com/
二、pdf官方開放接口: https://www.adobe.com/content...
三、https://blog.csdn.net/badgirl...code