下载 pdfobject.min.js
官网:https://pdfobject.com/
<script type="text/javascript" src="js/pdfobject.min.js"></script>
//设置展示pdf的容器 div
<div id="pdf" style="height: 800px; line-height: 162px;text-align: center;"></div>
//加载pdf,
if(PDFObject.supportsPDFs){
// PDF嵌入到网页
PDFObject.embed(文件路径, "#pdf" ); //参数2:div容器的id
} else {
location.href = "/canvas";
}